annotate mm7_6.cpp @ 1016:c45d51b3f4f4

Included header files cleanup
author Grumpy7
date Sun, 19 May 2013 17:55:19 +0200
parents 9318dd3f3711
children 9ac94d00012e
rev   line source
0
Ritor1
parents:
diff changeset
1 #include "MM7.h"
Ritor1
parents:
diff changeset
2
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
3
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
4
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
5 #include "Sprites.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
6 #include "BSPModel.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
7 #include "OutdoorCamera.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
8 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
9 #include "Keyboard.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
10 #include "stru6.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
11
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
12 #include "Vis.h"
0
Ritor1
parents:
diff changeset
13 #include "Game.h"
Ritor1
parents:
diff changeset
14 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
15 #include "GUIFont.h"
Ritor1
parents:
diff changeset
16 #include "Party.h"
Ritor1
parents:
diff changeset
17 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
18 #include "Outdoor.h"
Ritor1
parents:
diff changeset
19 #include "Overlays.h"
Ritor1
parents:
diff changeset
20 #include "LOD.h"
Ritor1
parents:
diff changeset
21 #include "Actor.h"
Ritor1
parents:
diff changeset
22 #include "Events.h"
Ritor1
parents:
diff changeset
23 #include "Viewport.h"
Ritor1
parents:
diff changeset
24 #include "Math.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
25 #include "SpriteObject.h"
0
Ritor1
parents:
diff changeset
26 #include "ObjectList.h"
Ritor1
parents:
diff changeset
27 #include "stru123.h"
Ritor1
parents:
diff changeset
28 #include "Time.h"
Ritor1
parents:
diff changeset
29 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
30 #include "Awards.h"
Ritor1
parents:
diff changeset
31 #include "TurnEngine.h"
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
32 #include "CastSpellInfo.h"
0
Ritor1
parents:
diff changeset
33 #include "stru298.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 169
diff changeset
34 #include "texts.h"
0
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36 #include "mm7_data.h"
Ritor1
parents:
diff changeset
37
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40 //----- (00424EE0) --------------------------------------------------------
Ritor1
parents:
diff changeset
41 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID)
Ritor1
parents:
diff changeset
42 {
Ritor1
parents:
diff changeset
43 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
44 double v2; // st7@1
Ritor1
parents:
diff changeset
45 signed int v3; // edi@1
Ritor1
parents:
diff changeset
46 char *v4; // esi@4
Ritor1
parents:
diff changeset
47 char *v5; // ecx@4
Ritor1
parents:
diff changeset
48 unsigned int v6; // eax@4
Ritor1
parents:
diff changeset
49 char *v7; // edx@4
Ritor1
parents:
diff changeset
50 double v8; // st6@10
Ritor1
parents:
diff changeset
51 double v9; // st5@10
Ritor1
parents:
diff changeset
52 double v10; // st6@11
Ritor1
parents:
diff changeset
53 unsigned __int8 v11; // c2@15
Ritor1
parents:
diff changeset
54 unsigned __int8 v12; // c3@15
Ritor1
parents:
diff changeset
55 void *v13; // edi@22
Ritor1
parents:
diff changeset
56 char *v14; // eax@22
Ritor1
parents:
diff changeset
57 double v15; // st6@22
Ritor1
parents:
diff changeset
58 char *v16; // ecx@22
Ritor1
parents:
diff changeset
59 signed int result; // eax@24
Ritor1
parents:
diff changeset
60 unsigned int v18; // [sp+8h] [bp-2Ch]@4
Ritor1
parents:
diff changeset
61 bool v19; // [sp+Ch] [bp-28h]@6
Ritor1
parents:
diff changeset
62 char *v20; // [sp+10h] [bp-24h]@4
Ritor1
parents:
diff changeset
63 char *v21; // [sp+14h] [bp-20h]@4
Ritor1
parents:
diff changeset
64 signed int v22; // [sp+18h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
65 char *v23; // [sp+1Ch] [bp-18h]@4
Ritor1
parents:
diff changeset
66 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4
Ritor1
parents:
diff changeset
67 char *v25; // [sp+24h] [bp-10h]@4
Ritor1
parents:
diff changeset
68 char *v26; // [sp+28h] [bp-Ch]@4
Ritor1
parents:
diff changeset
69 char *v27; // [sp+2Ch] [bp-8h]@4
Ritor1
parents:
diff changeset
70 char *v28; // [sp+30h] [bp-4h]@4
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72 v1 = uVertexID;
Ritor1
parents:
diff changeset
73 v2 = (double)pOutdoorCamera->shading_dist_mist;
Ritor1
parents:
diff changeset
74 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
75 v3 = 0;
Ritor1
parents:
diff changeset
76 v22 = 0;
Ritor1
parents:
diff changeset
77 if ( array_50AC10[0].vWorldViewPosition.x <= v2 )
Ritor1
parents:
diff changeset
78 v3 = 1;
Ritor1
parents:
diff changeset
79 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
80 return 0;
Ritor1
parents:
diff changeset
81 v4 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
82 v5 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
83 v6 = v1;
Ritor1
parents:
diff changeset
84 v23 = (char *)&array_507D30[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
85 v26 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
86 v24 = array_507D30;
Ritor1
parents:
diff changeset
87 v20 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
88 v21 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
89 v25 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
90 v27 = (char *)&array_507D30[0].v;
Ritor1
parents:
diff changeset
91 v28 = (char *)&array_507D30[0].u;
Ritor1
parents:
diff changeset
92 v7 = (char *)&array_50AC10[0].v;
Ritor1
parents:
diff changeset
93 v18 = v6;
Ritor1
parents:
diff changeset
94 do
Ritor1
parents:
diff changeset
95 {
Ritor1
parents:
diff changeset
96 v19 = v2 >= *((float *)v7 + 5);
Ritor1
parents:
diff changeset
97 if ( v3 != v19 )
Ritor1
parents:
diff changeset
98 {
Ritor1
parents:
diff changeset
99 if ( v19 )
Ritor1
parents:
diff changeset
100 {
Ritor1
parents:
diff changeset
101 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7));
Ritor1
parents:
diff changeset
102 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6);
Ritor1
parents:
diff changeset
103 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5);
Ritor1
parents:
diff changeset
104 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1);
Ritor1
parents:
diff changeset
105 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7;
Ritor1
parents:
diff changeset
106 }
Ritor1
parents:
diff changeset
107 else
Ritor1
parents:
diff changeset
108 {
Ritor1
parents:
diff changeset
109 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5));
Ritor1
parents:
diff changeset
110 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6);
Ritor1
parents:
diff changeset
111 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7);
Ritor1
parents:
diff changeset
112 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11);
Ritor1
parents:
diff changeset
113 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12);
Ritor1
parents:
diff changeset
114 }
Ritor1
parents:
diff changeset
115 *(float *)v27 = v9;
Ritor1
parents:
diff changeset
116 *(float *)v25 = v2;
Ritor1
parents:
diff changeset
117 *(float *)v26 = 1.0 / v2;
Ritor1
parents:
diff changeset
118 if ( v3 )
Ritor1
parents:
diff changeset
119 {
Ritor1
parents:
diff changeset
120 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) )
Ritor1
parents:
diff changeset
121 {
Ritor1
parents:
diff changeset
122 v11 = 0;
Ritor1
parents:
diff changeset
123 v12 = *(float *)v4 == *((float *)v7 - 5);
Ritor1
parents:
diff changeset
124 goto LABEL_19;
Ritor1
parents:
diff changeset
125 }
Ritor1
parents:
diff changeset
126 }
Ritor1
parents:
diff changeset
127 else
Ritor1
parents:
diff changeset
128 {
Ritor1
parents:
diff changeset
129 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) )
Ritor1
parents:
diff changeset
130 {
Ritor1
parents:
diff changeset
131 v11 = 0;
Ritor1
parents:
diff changeset
132 v12 = *(float *)v4 == *((float *)v7 + 7);
Ritor1
parents:
diff changeset
133 LABEL_19:
Ritor1
parents:
diff changeset
134 if ( v12 | v11 )
Ritor1
parents:
diff changeset
135 goto LABEL_21;
Ritor1
parents:
diff changeset
136 goto LABEL_20;
Ritor1
parents:
diff changeset
137 }
Ritor1
parents:
diff changeset
138 }
Ritor1
parents:
diff changeset
139 LABEL_20:
Ritor1
parents:
diff changeset
140 v26 += 48;
Ritor1
parents:
diff changeset
141 ++v24;
Ritor1
parents:
diff changeset
142 v25 += 48;
Ritor1
parents:
diff changeset
143 v27 += 48;
Ritor1
parents:
diff changeset
144 v28 += 48;
Ritor1
parents:
diff changeset
145 v5 += 48;
Ritor1
parents:
diff changeset
146 v4 += 48;
Ritor1
parents:
diff changeset
147 ++v22;
Ritor1
parents:
diff changeset
148 v23 += 48;
Ritor1
parents:
diff changeset
149 v21 = v5;
Ritor1
parents:
diff changeset
150 v20 = v4;
Ritor1
parents:
diff changeset
151 }
Ritor1
parents:
diff changeset
152 LABEL_21:
Ritor1
parents:
diff changeset
153 if ( v19 )
Ritor1
parents:
diff changeset
154 {
Ritor1
parents:
diff changeset
155 v13 = v24;
Ritor1
parents:
diff changeset
156 v14 = v26;
Ritor1
parents:
diff changeset
157 v21 += 48;
Ritor1
parents:
diff changeset
158 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001);
Ritor1
parents:
diff changeset
159 v20 += 48;
Ritor1
parents:
diff changeset
160 ++v22;
Ritor1
parents:
diff changeset
161 v28 += 48;
Ritor1
parents:
diff changeset
162 v27 += 48;
Ritor1
parents:
diff changeset
163 v25 += 48;
Ritor1
parents:
diff changeset
164 ++v24;
Ritor1
parents:
diff changeset
165 v26 += 48;
Ritor1
parents:
diff changeset
166 memcpy(v13, v7 + 8, 0x30u);
Ritor1
parents:
diff changeset
167 v16 = v23;
Ritor1
parents:
diff changeset
168 v23 += 48;
Ritor1
parents:
diff changeset
169 v4 = v20;
Ritor1
parents:
diff changeset
170 *(float *)v14 = v15;
Ritor1
parents:
diff changeset
171 *(int *)v16 = *((int *)v7 + 13);
Ritor1
parents:
diff changeset
172 v5 = v21;
Ritor1
parents:
diff changeset
173 }
Ritor1
parents:
diff changeset
174 v3 = v19;
Ritor1
parents:
diff changeset
175 v7 += 48;
Ritor1
parents:
diff changeset
176 --v18;
Ritor1
parents:
diff changeset
177 }
Ritor1
parents:
diff changeset
178 while ( v18 );
Ritor1
parents:
diff changeset
179 result = v22;
Ritor1
parents:
diff changeset
180 if ( v22 < 3 )
Ritor1
parents:
diff changeset
181 return 0;
Ritor1
parents:
diff changeset
182 return result;
Ritor1
parents:
diff changeset
183 }
Ritor1
parents:
diff changeset
184
Ritor1
parents:
diff changeset
185 //----- (004250FE) --------------------------------------------------------
Ritor1
parents:
diff changeset
186 signed int __fastcall sr_4250FE(unsigned int uVertexID)
Ritor1
parents:
diff changeset
187 {
Ritor1
parents:
diff changeset
188 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
189 char *v2; // edi@5
Ritor1
parents:
diff changeset
190 char *v3; // esi@5
Ritor1
parents:
diff changeset
191 char *v4; // ecx@5
Ritor1
parents:
diff changeset
192 int v5; // ebx@6
Ritor1
parents:
diff changeset
193 double v6; // st6@11
Ritor1
parents:
diff changeset
194 double v7; // st5@11
Ritor1
parents:
diff changeset
195 double v8; // st6@12
Ritor1
parents:
diff changeset
196 unsigned __int8 v9; // c2@16
Ritor1
parents:
diff changeset
197 unsigned __int8 v10; // c3@16
Ritor1
parents:
diff changeset
198 void *v11; // edi@23
Ritor1
parents:
diff changeset
199 double v12; // st6@23
Ritor1
parents:
diff changeset
200 char *v13; // ecx@23
Ritor1
parents:
diff changeset
201 char v14; // zf@24
Ritor1
parents:
diff changeset
202 signed int result; // eax@25
Ritor1
parents:
diff changeset
203 unsigned int v16; // [sp+8h] [bp-28h]@5
Ritor1
parents:
diff changeset
204 bool v17; // [sp+Ch] [bp-24h]@2
Ritor1
parents:
diff changeset
205 bool v18; // [sp+10h] [bp-20h]@7
Ritor1
parents:
diff changeset
206 char *v19; // [sp+14h] [bp-1Ch]@5
Ritor1
parents:
diff changeset
207 char *v20; // [sp+18h] [bp-18h]@5
Ritor1
parents:
diff changeset
208 signed int v21; // [sp+1Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
209 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5
Ritor1
parents:
diff changeset
210 char *v23; // [sp+24h] [bp-Ch]@5
Ritor1
parents:
diff changeset
211 char *v24; // [sp+28h] [bp-8h]@5
Ritor1
parents:
diff changeset
212 char *v25; // [sp+2Ch] [bp-4h]@5
Ritor1
parents:
diff changeset
213
Ritor1
parents:
diff changeset
214 v1 = uVertexID;
Ritor1
parents:
diff changeset
215 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
216 v21 = 0;
Ritor1
parents:
diff changeset
217 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0;
Ritor1
parents:
diff changeset
218 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
219 return 0;
Ritor1
parents:
diff changeset
220 v2 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
221 v3 = (char *)&array_507D30[0].vWorldViewPosition.y;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
222 v24 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
223 v22 = array_507D30;
Ritor1
parents:
diff changeset
224 v19 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
225 v20 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
226 v23 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
227 v25 = (char *)&array_507D30[0].flt_2C;
Ritor1
parents:
diff changeset
228 v4 = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
229 v16 = v1;
Ritor1
parents:
diff changeset
230 do
Ritor1
parents:
diff changeset
231 {
Ritor1
parents:
diff changeset
232 v5 = (int)(v4 + 48);
Ritor1
parents:
diff changeset
233 v18 = *((float *)v4 + 12) >= 8.0;
Ritor1
parents:
diff changeset
234 if ( v17 != v18 )
Ritor1
parents:
diff changeset
235 {
Ritor1
parents:
diff changeset
236 if ( v18 )
Ritor1
parents:
diff changeset
237 {
Ritor1
parents:
diff changeset
238 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4);
Ritor1
parents:
diff changeset
239 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1);
Ritor1
parents:
diff changeset
240 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2);
Ritor1
parents:
diff changeset
241 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8);
Ritor1
parents:
diff changeset
242 }
Ritor1
parents:
diff changeset
243 else
Ritor1
parents:
diff changeset
244 {
Ritor1
parents:
diff changeset
245 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5);
Ritor1
parents:
diff changeset
246 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13);
Ritor1
parents:
diff changeset
247 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14);
Ritor1
parents:
diff changeset
248 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20);
Ritor1
parents:
diff changeset
249 }
Ritor1
parents:
diff changeset
250 *(float *)v25 = v7;
Ritor1
parents:
diff changeset
251 *(float *)v23 = 8.0;
Ritor1
parents:
diff changeset
252 *(int *)v24 = 0x3E000000u;
Ritor1
parents:
diff changeset
253 if ( v17 )
Ritor1
parents:
diff changeset
254 {
Ritor1
parents:
diff changeset
255 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) )
Ritor1
parents:
diff changeset
256 {
Ritor1
parents:
diff changeset
257 v9 = 0;
Ritor1
parents:
diff changeset
258 v10 = *(float *)v2 == *((float *)v4 + 2);
Ritor1
parents:
diff changeset
259 goto LABEL_20;
Ritor1
parents:
diff changeset
260 }
Ritor1
parents:
diff changeset
261 }
Ritor1
parents:
diff changeset
262 else
Ritor1
parents:
diff changeset
263 {
Ritor1
parents:
diff changeset
264 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) )
Ritor1
parents:
diff changeset
265 {
Ritor1
parents:
diff changeset
266 v9 = 0;
Ritor1
parents:
diff changeset
267 v10 = *(float *)v2 == *((float *)v4 + 14);
Ritor1
parents:
diff changeset
268 LABEL_20:
Ritor1
parents:
diff changeset
269 if ( v10 | v9 )
Ritor1
parents:
diff changeset
270 goto LABEL_22;
Ritor1
parents:
diff changeset
271 goto LABEL_21;
Ritor1
parents:
diff changeset
272 }
Ritor1
parents:
diff changeset
273 }
Ritor1
parents:
diff changeset
274 LABEL_21:
Ritor1
parents:
diff changeset
275 ++v22;
Ritor1
parents:
diff changeset
276 v23 += 48;
Ritor1
parents:
diff changeset
277 v25 += 48;
Ritor1
parents:
diff changeset
278 v3 += 48;
Ritor1
parents:
diff changeset
279 v2 += 48;
Ritor1
parents:
diff changeset
280 ++v21;
Ritor1
parents:
diff changeset
281 v24 += 48;
Ritor1
parents:
diff changeset
282 v20 = v3;
Ritor1
parents:
diff changeset
283 v19 = v2;
Ritor1
parents:
diff changeset
284 }
Ritor1
parents:
diff changeset
285 LABEL_22:
Ritor1
parents:
diff changeset
286 if ( v18 )
Ritor1
parents:
diff changeset
287 {
Ritor1
parents:
diff changeset
288 v11 = v22;
Ritor1
parents:
diff changeset
289 v20 += 48;
Ritor1
parents:
diff changeset
290 v19 += 48;
Ritor1
parents:
diff changeset
291 v12 = 1.0 / (*(float *)v5 + 0.0000001);
Ritor1
parents:
diff changeset
292 ++v21;
Ritor1
parents:
diff changeset
293 v25 += 48;
Ritor1
parents:
diff changeset
294 v23 += 48;
Ritor1
parents:
diff changeset
295 ++v22;
Ritor1
parents:
diff changeset
296 memcpy(v11, v4 + 36, 0x30u);
Ritor1
parents:
diff changeset
297 v13 = v24;
Ritor1
parents:
diff changeset
298 v24 += 48;
Ritor1
parents:
diff changeset
299 v3 = v20;
Ritor1
parents:
diff changeset
300 v2 = v19;
Ritor1
parents:
diff changeset
301 *(float *)v13 = v12;
Ritor1
parents:
diff changeset
302 }
Ritor1
parents:
diff changeset
303 v14 = v16-- == 1;
Ritor1
parents:
diff changeset
304 v17 = v18;
Ritor1
parents:
diff changeset
305 v4 = (char *)v5;
Ritor1
parents:
diff changeset
306 }
Ritor1
parents:
diff changeset
307 while ( !v14 );
Ritor1
parents:
diff changeset
308 result = v21;
Ritor1
parents:
diff changeset
309 if ( v21 < 3 )
Ritor1
parents:
diff changeset
310 return 0;
Ritor1
parents:
diff changeset
311 return result;
Ritor1
parents:
diff changeset
312 }
Ritor1
parents:
diff changeset
313
Ritor1
parents:
diff changeset
314 //----- (004252E8) --------------------------------------------------------
Ritor1
parents:
diff changeset
315 signed int __fastcall sr_4252E8(unsigned int uVertexID)
Ritor1
parents:
diff changeset
316 {
Ritor1
parents:
diff changeset
317 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
318 double v2; // st7@1
Ritor1
parents:
diff changeset
319 char *v3; // edi@5
Ritor1
parents:
diff changeset
320 char *v4; // esi@5
Ritor1
parents:
diff changeset
321 char *v5; // ecx@5
Ritor1
parents:
diff changeset
322 int v6; // ebx@6
Ritor1
parents:
diff changeset
323 double v7; // st6@11
Ritor1
parents:
diff changeset
324 double v8; // st5@11
Ritor1
parents:
diff changeset
325 double v9; // st6@12
Ritor1
parents:
diff changeset
326 unsigned __int8 v10; // c2@16
Ritor1
parents:
diff changeset
327 unsigned __int8 v11; // c3@16
Ritor1
parents:
diff changeset
328 void *v12; // edi@23
Ritor1
parents:
diff changeset
329 double v13; // st6@23
Ritor1
parents:
diff changeset
330 char *v14; // ecx@23
Ritor1
parents:
diff changeset
331 char v15; // zf@24
Ritor1
parents:
diff changeset
332 signed int result; // eax@25
Ritor1
parents:
diff changeset
333 unsigned int v17; // [sp+8h] [bp-28h]@5
Ritor1
parents:
diff changeset
334 bool v18; // [sp+Ch] [bp-24h]@2
Ritor1
parents:
diff changeset
335 bool v19; // [sp+10h] [bp-20h]@7
Ritor1
parents:
diff changeset
336 char *v20; // [sp+14h] [bp-1Ch]@5
Ritor1
parents:
diff changeset
337 char *v21; // [sp+18h] [bp-18h]@5
Ritor1
parents:
diff changeset
338 signed int v22; // [sp+1Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
339 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5
Ritor1
parents:
diff changeset
340 char *v24; // [sp+24h] [bp-Ch]@5
Ritor1
parents:
diff changeset
341 char *v25; // [sp+28h] [bp-8h]@5
Ritor1
parents:
diff changeset
342 char *v26; // [sp+2Ch] [bp-4h]@5
Ritor1
parents:
diff changeset
343
Ritor1
parents:
diff changeset
344 v1 = uVertexID;
Ritor1
parents:
diff changeset
345 v2 = (double)pOutdoorCamera->shading_dist_mist;
Ritor1
parents:
diff changeset
346 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
347 v22 = 0;
Ritor1
parents:
diff changeset
348 v18 = array_50AC10[0].vWorldViewPosition.x <= v2;
Ritor1
parents:
diff changeset
349 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
350 return 0;
Ritor1
parents:
diff changeset
351 v3 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
352 v4 = (char *)&array_507D30[0].vWorldViewPosition.y;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
353 v25 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
354 v23 = array_507D30;
Ritor1
parents:
diff changeset
355 v20 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
356 v21 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
357 v24 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
358 v26 = (char *)&array_507D30[0].flt_2C;
Ritor1
parents:
diff changeset
359 v5 = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
360 v17 = v1;
Ritor1
parents:
diff changeset
361 do
Ritor1
parents:
diff changeset
362 {
Ritor1
parents:
diff changeset
363 v6 = (int)(v5 + 48);
Ritor1
parents:
diff changeset
364 v19 = v2 >= *((float *)v5 + 12);
Ritor1
parents:
diff changeset
365 if ( v18 != v19 )
Ritor1
parents:
diff changeset
366 {
Ritor1
parents:
diff changeset
367 if ( v19 )
Ritor1
parents:
diff changeset
368 {
Ritor1
parents:
diff changeset
369 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5);
Ritor1
parents:
diff changeset
370 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1);
Ritor1
parents:
diff changeset
371 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2);
Ritor1
parents:
diff changeset
372 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8);
Ritor1
parents:
diff changeset
373 }
Ritor1
parents:
diff changeset
374 else
Ritor1
parents:
diff changeset
375 {
Ritor1
parents:
diff changeset
376 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6);
Ritor1
parents:
diff changeset
377 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13);
Ritor1
parents:
diff changeset
378 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14);
Ritor1
parents:
diff changeset
379 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20);
Ritor1
parents:
diff changeset
380 }
Ritor1
parents:
diff changeset
381 *(float *)v26 = v8;
Ritor1
parents:
diff changeset
382 *(float *)v24 = v2;
Ritor1
parents:
diff changeset
383 *(float *)v25 = 1.0 / v2;
Ritor1
parents:
diff changeset
384 if ( v18 )
Ritor1
parents:
diff changeset
385 {
Ritor1
parents:
diff changeset
386 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) )
Ritor1
parents:
diff changeset
387 {
Ritor1
parents:
diff changeset
388 v10 = 0;
Ritor1
parents:
diff changeset
389 v11 = *(float *)v3 == *((float *)v5 + 2);
Ritor1
parents:
diff changeset
390 goto LABEL_20;
Ritor1
parents:
diff changeset
391 }
Ritor1
parents:
diff changeset
392 }
Ritor1
parents:
diff changeset
393 else
Ritor1
parents:
diff changeset
394 {
Ritor1
parents:
diff changeset
395 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) )
Ritor1
parents:
diff changeset
396 {
Ritor1
parents:
diff changeset
397 v10 = 0;
Ritor1
parents:
diff changeset
398 v11 = *(float *)v3 == *((float *)v5 + 14);
Ritor1
parents:
diff changeset
399 LABEL_20:
Ritor1
parents:
diff changeset
400 if ( v11 | v10 )
Ritor1
parents:
diff changeset
401 goto LABEL_22;
Ritor1
parents:
diff changeset
402 goto LABEL_21;
Ritor1
parents:
diff changeset
403 }
Ritor1
parents:
diff changeset
404 }
Ritor1
parents:
diff changeset
405 LABEL_21:
Ritor1
parents:
diff changeset
406 ++v23;
Ritor1
parents:
diff changeset
407 v24 += 48;
Ritor1
parents:
diff changeset
408 v26 += 48;
Ritor1
parents:
diff changeset
409 v4 += 48;
Ritor1
parents:
diff changeset
410 v3 += 48;
Ritor1
parents:
diff changeset
411 ++v22;
Ritor1
parents:
diff changeset
412 v25 += 48;
Ritor1
parents:
diff changeset
413 v21 = v4;
Ritor1
parents:
diff changeset
414 v20 = v3;
Ritor1
parents:
diff changeset
415 }
Ritor1
parents:
diff changeset
416 LABEL_22:
Ritor1
parents:
diff changeset
417 if ( v19 )
Ritor1
parents:
diff changeset
418 {
Ritor1
parents:
diff changeset
419 v12 = v23;
Ritor1
parents:
diff changeset
420 v21 += 48;
Ritor1
parents:
diff changeset
421 v20 += 48;
Ritor1
parents:
diff changeset
422 v13 = 1.0 / (*(float *)v6 + 0.0000001);
Ritor1
parents:
diff changeset
423 ++v22;
Ritor1
parents:
diff changeset
424 v26 += 48;
Ritor1
parents:
diff changeset
425 v24 += 48;
Ritor1
parents:
diff changeset
426 ++v23;
Ritor1
parents:
diff changeset
427 memcpy(v12, v5 + 36, 0x30u);
Ritor1
parents:
diff changeset
428 v14 = v25;
Ritor1
parents:
diff changeset
429 v25 += 48;
Ritor1
parents:
diff changeset
430 v4 = v21;
Ritor1
parents:
diff changeset
431 v3 = v20;
Ritor1
parents:
diff changeset
432 *(float *)v14 = v13;
Ritor1
parents:
diff changeset
433 }
Ritor1
parents:
diff changeset
434 v15 = v17-- == 1;
Ritor1
parents:
diff changeset
435 v18 = v19;
Ritor1
parents:
diff changeset
436 v5 = (char *)v6;
Ritor1
parents:
diff changeset
437 }
Ritor1
parents:
diff changeset
438 while ( !v15 );
Ritor1
parents:
diff changeset
439 result = v22;
Ritor1
parents:
diff changeset
440 if ( v22 < 3 )
Ritor1
parents:
diff changeset
441 return 0;
Ritor1
parents:
diff changeset
442 return result;
Ritor1
parents:
diff changeset
443 }
Ritor1
parents:
diff changeset
444
Ritor1
parents:
diff changeset
445 //----- (004254D2) --------------------------------------------------------
Ritor1
parents:
diff changeset
446 int __fastcall sr_4254D2(signed int a1)
Ritor1
parents:
diff changeset
447 {
Ritor1
parents:
diff changeset
448 signed int v1; // ebx@2
Ritor1
parents:
diff changeset
449 int v2; // ecx@2
Ritor1
parents:
diff changeset
450 int result; // eax@11
Ritor1
parents:
diff changeset
451 double v4; // ST74_8@12
Ritor1
parents:
diff changeset
452 bool v5; // edi@12
Ritor1
parents:
diff changeset
453 char *v6; // esi@13
Ritor1
parents:
diff changeset
454 char *v7; // ebx@13
Ritor1
parents:
diff changeset
455 double v8; // st7@15
Ritor1
parents:
diff changeset
456 double v9; // st7@16
Ritor1
parents:
diff changeset
457 double v10; // st6@16
Ritor1
parents:
diff changeset
458 double v11; // st7@17
Ritor1
parents:
diff changeset
459 float v12; // eax@18
Ritor1
parents:
diff changeset
460 double v13; // ST4C_8@19
Ritor1
parents:
diff changeset
461 double v14; // ST10_8@19
Ritor1
parents:
diff changeset
462 double v15; // ST28_8@20
Ritor1
parents:
diff changeset
463 double v16; // ST34_8@20
Ritor1
parents:
diff changeset
464 char v17; // zf@20
Ritor1
parents:
diff changeset
465 double v18; // ST18_8@21
Ritor1
parents:
diff changeset
466 double v19; // ST3C_8@21
Ritor1
parents:
diff changeset
467 double v20; // ST44_8@22
Ritor1
parents:
diff changeset
468 double v21; // ST54_8@22
Ritor1
parents:
diff changeset
469 void *v22; // edi@26
Ritor1
parents:
diff changeset
470 double v23; // ST54_8@29
Ritor1
parents:
diff changeset
471 bool v24; // esi@29
Ritor1
parents:
diff changeset
472 char *v25; // edi@30
Ritor1
parents:
diff changeset
473 char *v26; // ebx@30
Ritor1
parents:
diff changeset
474 bool v27; // ecx@32
Ritor1
parents:
diff changeset
475 double v28; // st7@33
Ritor1
parents:
diff changeset
476 double v29; // st7@34
Ritor1
parents:
diff changeset
477 double v30; // st6@34
Ritor1
parents:
diff changeset
478 double v31; // st7@35
Ritor1
parents:
diff changeset
479 double v32; // ST44_8@37
Ritor1
parents:
diff changeset
480 double v33; // ST3C_8@37
Ritor1
parents:
diff changeset
481 double v34; // ST18_8@38
Ritor1
parents:
diff changeset
482 double v35; // ST34_8@38
Ritor1
parents:
diff changeset
483 char v36; // zf@38
Ritor1
parents:
diff changeset
484 double v37; // ST28_8@39
Ritor1
parents:
diff changeset
485 double v38; // ST10_8@39
Ritor1
parents:
diff changeset
486 double v39; // ST20_8@40
Ritor1
parents:
diff changeset
487 double v40; // ST5C_8@40
Ritor1
parents:
diff changeset
488 void *v41; // edi@44
Ritor1
parents:
diff changeset
489 double v42; // ST5C_8@47
Ritor1
parents:
diff changeset
490 bool v43; // edi@47
Ritor1
parents:
diff changeset
491 char *v44; // esi@48
Ritor1
parents:
diff changeset
492 char *v45; // ebx@48
Ritor1
parents:
diff changeset
493 bool v46; // ecx@49
Ritor1
parents:
diff changeset
494 double v47; // st6@50
Ritor1
parents:
diff changeset
495 double v48; // st6@51
Ritor1
parents:
diff changeset
496 double v49; // st5@51
Ritor1
parents:
diff changeset
497 double v50; // st6@52
Ritor1
parents:
diff changeset
498 double v51; // ST20_8@54
Ritor1
parents:
diff changeset
499 double v52; // ST54_8@54
Ritor1
parents:
diff changeset
500 double v53; // ST44_8@55
Ritor1
parents:
diff changeset
501 double v54; // ST3C_8@55
Ritor1
parents:
diff changeset
502 char v55; // zf@55
Ritor1
parents:
diff changeset
503 double v56; // ST18_8@56
Ritor1
parents:
diff changeset
504 double v57; // ST34_8@56
Ritor1
parents:
diff changeset
505 double v58; // ST28_8@57
Ritor1
parents:
diff changeset
506 double v59; // ST10_8@57
Ritor1
parents:
diff changeset
507 void *v60; // edi@61
Ritor1
parents:
diff changeset
508 double v61; // ST5C_8@64
Ritor1
parents:
diff changeset
509 bool v62; // edi@64
Ritor1
parents:
diff changeset
510 char *v63; // esi@65
Ritor1
parents:
diff changeset
511 char *v64; // ebx@65
Ritor1
parents:
diff changeset
512 bool v65; // ecx@66
Ritor1
parents:
diff changeset
513 double v66; // st6@67
Ritor1
parents:
diff changeset
514 double v67; // st6@68
Ritor1
parents:
diff changeset
515 double v68; // st5@68
Ritor1
parents:
diff changeset
516 double v69; // st6@69
Ritor1
parents:
diff changeset
517 double v70; // ST20_8@71
Ritor1
parents:
diff changeset
518 double v71; // ST54_8@71
Ritor1
parents:
diff changeset
519 double v72; // ST44_8@72
Ritor1
parents:
diff changeset
520 double v73; // ST3C_8@72
Ritor1
parents:
diff changeset
521 char v74; // zf@72
Ritor1
parents:
diff changeset
522 double v75; // ST18_8@73
Ritor1
parents:
diff changeset
523 double v76; // ST34_8@73
Ritor1
parents:
diff changeset
524 double v77; // ST28_8@74
Ritor1
parents:
diff changeset
525 double v78; // ST10_8@74
Ritor1
parents:
diff changeset
526 void *v79; // edi@78
Ritor1
parents:
diff changeset
527 int v80; // ebx@81
Ritor1
parents:
diff changeset
528 char *v81; // ecx@82
Ritor1
parents:
diff changeset
529 signed int v82; // esi@82
Ritor1
parents:
diff changeset
530 float v83; // ST78_4@83
Ritor1
parents:
diff changeset
531 double v84; // ST5C_8@83
Ritor1
parents:
diff changeset
532 float v85; // eax@84
Ritor1
parents:
diff changeset
533 double v86; // ST20_8@85
Ritor1
parents:
diff changeset
534 double v87; // ST54_8@88
Ritor1
parents:
diff changeset
535 float v88; // eax@89
Ritor1
parents:
diff changeset
536 double v89; // ST44_8@90
Ritor1
parents:
diff changeset
537 unsigned __int8 v90; // sf@94
Ritor1
parents:
diff changeset
538 unsigned __int8 v91; // of@94
Ritor1
parents:
diff changeset
539 int v92; // edx@97
Ritor1
parents:
diff changeset
540 int v93; // esi@97
Ritor1
parents:
diff changeset
541 int v94; // edi@97
Ritor1
parents:
diff changeset
542 int v95; // eax@97
Ritor1
parents:
diff changeset
543 int v96; // eax@104
Ritor1
parents:
diff changeset
544 double v97; // [sp+4Ch] [bp-8Ch]@32
Ritor1
parents:
diff changeset
545 double v98; // [sp+54h] [bp-84h]@49
Ritor1
parents:
diff changeset
546 double v99; // [sp+54h] [bp-84h]@66
Ritor1
parents:
diff changeset
547 float v100; // [sp+5Ch] [bp-7Ch]@1
Ritor1
parents:
diff changeset
548 float v101; // [sp+60h] [bp-78h]@1
Ritor1
parents:
diff changeset
549 float v102; // [sp+64h] [bp-74h]@1
Ritor1
parents:
diff changeset
550 double v103; // [sp+6Ch] [bp-6Ch]@14
Ritor1
parents:
diff changeset
551 float v104; // [sp+A8h] [bp-30h]@1
Ritor1
parents:
diff changeset
552 signed int v105; // [sp+A8h] [bp-30h]@96
Ritor1
parents:
diff changeset
553 bool v106; // [sp+ACh] [bp-2Ch]@14
Ritor1
parents:
diff changeset
554 bool v107; // [sp+ACh] [bp-2Ch]@32
Ritor1
parents:
diff changeset
555 bool v108; // [sp+ACh] [bp-2Ch]@49
Ritor1
parents:
diff changeset
556 bool v109; // [sp+ACh] [bp-2Ch]@66
Ritor1
parents:
diff changeset
557 signed int v110; // [sp+B0h] [bp-28h]@12
Ritor1
parents:
diff changeset
558 char *v111; // [sp+B8h] [bp-20h]@30
Ritor1
parents:
diff changeset
559 signed int v112; // [sp+B8h] [bp-20h]@48
Ritor1
parents:
diff changeset
560 signed int v113; // [sp+B8h] [bp-20h]@65
Ritor1
parents:
diff changeset
561 char *v114; // [sp+BCh] [bp-1Ch]@13
Ritor1
parents:
diff changeset
562 signed int v115; // [sp+BCh] [bp-1Ch]@29
Ritor1
parents:
diff changeset
563 signed int v116; // [sp+BCh] [bp-1Ch]@64
Ritor1
parents:
diff changeset
564 signed int v117; // [sp+C0h] [bp-18h]@1
Ritor1
parents:
diff changeset
565 char *v118; // [sp+C0h] [bp-18h]@30
Ritor1
parents:
diff changeset
566 char *v119; // [sp+C0h] [bp-18h]@48
Ritor1
parents:
diff changeset
567 char *v120; // [sp+C0h] [bp-18h]@65
Ritor1
parents:
diff changeset
568 char *v121; // [sp+C4h] [bp-14h]@13
Ritor1
parents:
diff changeset
569 char *v122; // [sp+C4h] [bp-14h]@30
Ritor1
parents:
diff changeset
570 signed int v123; // [sp+C4h] [bp-14h]@47
Ritor1
parents:
diff changeset
571 char *v124; // [sp+C8h] [bp-10h]@30
Ritor1
parents:
diff changeset
572 char *v125; // [sp+C8h] [bp-10h]@48
Ritor1
parents:
diff changeset
573 char *v126; // [sp+C8h] [bp-10h]@65
Ritor1
parents:
diff changeset
574 signed int v127; // [sp+CCh] [bp-Ch]@2
Ritor1
parents:
diff changeset
575 char *v128; // [sp+CCh] [bp-Ch]@13
Ritor1
parents:
diff changeset
576 char *v129; // [sp+CCh] [bp-Ch]@30
Ritor1
parents:
diff changeset
577 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48
Ritor1
parents:
diff changeset
578 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65
Ritor1
parents:
diff changeset
579 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13
Ritor1
parents:
diff changeset
580 char *v133; // [sp+D0h] [bp-8h]@30
Ritor1
parents:
diff changeset
581 char *v134; // [sp+D0h] [bp-8h]@48
Ritor1
parents:
diff changeset
582 char *v135; // [sp+D0h] [bp-8h]@65
Ritor1
parents:
diff changeset
583 signed int v136; // [sp+D4h] [bp-4h]@1
Ritor1
parents:
diff changeset
584 char *v137; // [sp+D4h] [bp-4h]@13
Ritor1
parents:
diff changeset
585 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30
Ritor1
parents:
diff changeset
586 char *v139; // [sp+D4h] [bp-4h]@48
Ritor1
parents:
diff changeset
587 char *v140; // [sp+D4h] [bp-4h]@65
Ritor1
parents:
diff changeset
588
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
589 v101 = (double)(signed int)pViewport->uViewportTL_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
590 v100 = (double)(signed int)pViewport->uViewportBR_X;
0
Ritor1
parents:
diff changeset
591 v117 = a1;
Ritor1
parents:
diff changeset
592 v136 = 1;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
593 v104 = (double)(signed int)pViewport->uViewportTL_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
594 v102 = (double)(pViewport->uViewportBR_Y + 1);
0
Ritor1
parents:
diff changeset
595 if ( a1 <= 0 )
Ritor1
parents:
diff changeset
596 return v117;
Ritor1
parents:
diff changeset
597 v127 = a1;
Ritor1
parents:
diff changeset
598 v1 = a1;
Ritor1
parents:
diff changeset
599 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2));
Ritor1
parents:
diff changeset
600 v2 = 0;
Ritor1
parents:
diff changeset
601 do
Ritor1
parents:
diff changeset
602 {
Ritor1
parents:
diff changeset
603 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 )
Ritor1
parents:
diff changeset
604 v136 = 0;
Ritor1
parents:
diff changeset
605 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 )
Ritor1
parents:
diff changeset
606 v136 = 0;
Ritor1
parents:
diff changeset
607 ++v2;
Ritor1
parents:
diff changeset
608 --v127;
Ritor1
parents:
diff changeset
609 }
Ritor1
parents:
diff changeset
610 while ( v127 );
Ritor1
parents:
diff changeset
611 if ( v136 )
Ritor1
parents:
diff changeset
612 return v117;
Ritor1
parents:
diff changeset
613 v110 = 0;
Ritor1
parents:
diff changeset
614 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1]));
Ritor1
parents:
diff changeset
615 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
616 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportTL_X;
0
Ritor1
parents:
diff changeset
617 if ( v117 < 1 )
Ritor1
parents:
diff changeset
618 goto LABEL_112;
Ritor1
parents:
diff changeset
619 v6 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
620 v132 = array_50A2B0;
Ritor1
parents:
diff changeset
621 v137 = (char *)&array_50A2B0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
622 v128 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
623 v121 = (char *)&array_50A2B0[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
624 v114 = (char *)&array_50A2B0[0]._rhw;
0
Ritor1
parents:
diff changeset
625 v7 = (char *)&array_50AC10[0].flt_2C;
Ritor1
parents:
diff changeset
626 do
Ritor1
parents:
diff changeset
627 {
Ritor1
parents:
diff changeset
628 v103 = *((float *)v7 + 7) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
629 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportTL_X;
0
Ritor1
parents:
diff changeset
630 if ( !(v5 ^ v106) )
Ritor1
parents:
diff changeset
631 goto LABEL_25;
Ritor1
parents:
diff changeset
632 v8 = v101;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
633 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportTL_X )
0
Ritor1
parents:
diff changeset
634 {
Ritor1
parents:
diff changeset
635 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5));
Ritor1
parents:
diff changeset
636 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4);
Ritor1
parents:
diff changeset
637 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3);
Ritor1
parents:
diff changeset
638 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7;
Ritor1
parents:
diff changeset
639 }
Ritor1
parents:
diff changeset
640 else
Ritor1
parents:
diff changeset
641 {
Ritor1
parents:
diff changeset
642 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7));
Ritor1
parents:
diff changeset
643 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8);
Ritor1
parents:
diff changeset
644 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9);
Ritor1
parents:
diff changeset
645 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12);
Ritor1
parents:
diff changeset
646 }
Ritor1
parents:
diff changeset
647 *(float *)v121 = v10;
Ritor1
parents:
diff changeset
648 *(int *)v137 = LODWORD(v101);
Ritor1
parents:
diff changeset
649 LODWORD(v12) = *(int *)v6;
Ritor1
parents:
diff changeset
650 if ( v5 )
Ritor1
parents:
diff changeset
651 {
Ritor1
parents:
diff changeset
652 v13 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
653 v14 = *((float *)v7 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
654 if ( LODWORD(v13) == LODWORD(v14) )
Ritor1
parents:
diff changeset
655 {
Ritor1
parents:
diff changeset
656 v15 = *(float *)v137 + 6.7553994e15;
Ritor1
parents:
diff changeset
657 v16 = *((float *)v7 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
658 v17 = LODWORD(v15) == LODWORD(v16);
Ritor1
parents:
diff changeset
659 goto LABEL_23;
Ritor1
parents:
diff changeset
660 }
Ritor1
parents:
diff changeset
661 }
Ritor1
parents:
diff changeset
662 else
Ritor1
parents:
diff changeset
663 {
Ritor1
parents:
diff changeset
664 v18 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
665 v19 = *((float *)v7 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
666 if ( LODWORD(v18) == LODWORD(v19) )
Ritor1
parents:
diff changeset
667 {
Ritor1
parents:
diff changeset
668 v20 = *(float *)v137 + 6.7553994e15;
Ritor1
parents:
diff changeset
669 v21 = *((float *)v7 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
670 v17 = LODWORD(v20) == LODWORD(v21);
Ritor1
parents:
diff changeset
671 LABEL_23:
Ritor1
parents:
diff changeset
672 if ( v17 )
Ritor1
parents:
diff changeset
673 goto LABEL_25;
Ritor1
parents:
diff changeset
674 goto LABEL_24;
Ritor1
parents:
diff changeset
675 }
Ritor1
parents:
diff changeset
676 }
Ritor1
parents:
diff changeset
677 LABEL_24:
Ritor1
parents:
diff changeset
678 v121 += 48;
Ritor1
parents:
diff changeset
679 v114 += 48;
Ritor1
parents:
diff changeset
680 v6 += 48;
Ritor1
parents:
diff changeset
681 ++v110;
Ritor1
parents:
diff changeset
682 ++v132;
Ritor1
parents:
diff changeset
683 v128 = v6;
Ritor1
parents:
diff changeset
684 v137 += 48;
Ritor1
parents:
diff changeset
685 LABEL_25:
Ritor1
parents:
diff changeset
686 if ( v106 )
Ritor1
parents:
diff changeset
687 {
Ritor1
parents:
diff changeset
688 v22 = v132;
Ritor1
parents:
diff changeset
689 v128 += 48;
Ritor1
parents:
diff changeset
690 ++v110;
Ritor1
parents:
diff changeset
691 v114 += 48;
Ritor1
parents:
diff changeset
692 v121 += 48;
Ritor1
parents:
diff changeset
693 v137 += 48;
Ritor1
parents:
diff changeset
694 ++v132;
Ritor1
parents:
diff changeset
695 memcpy(v22, v7 + 4, 0x30u);
Ritor1
parents:
diff changeset
696 v6 = v128;
Ritor1
parents:
diff changeset
697 }
Ritor1
parents:
diff changeset
698 v5 = v106;
Ritor1
parents:
diff changeset
699 v7 += 48;
Ritor1
parents:
diff changeset
700 --v117;
Ritor1
parents:
diff changeset
701 }
Ritor1
parents:
diff changeset
702 while ( v117 );
Ritor1
parents:
diff changeset
703 if ( v110 < 3
Ritor1
parents:
diff changeset
704 || (v115 = 0,
Ritor1
parents:
diff changeset
705 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])),
Ritor1
parents:
diff changeset
706 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15,
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
707 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportBR_X,
0
Ritor1
parents:
diff changeset
708 v110 < 1) )
Ritor1
parents:
diff changeset
709 goto LABEL_112;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
710 v25 = (char *)&array_509950[0]._rhw;
0
Ritor1
parents:
diff changeset
711 v138 = array_509950;
Ritor1
parents:
diff changeset
712 v129 = (char *)&array_50A2B0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
713 v118 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
714 v133 = (char *)&array_509950[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
715 v122 = (char *)&array_509950[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
716 v124 = (char *)&array_509950[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
717 v111 = (char *)&array_509950[0]._rhw;
0
Ritor1
parents:
diff changeset
718 v26 = (char *)&array_50A2B0[0].flt_2C;
Ritor1
parents:
diff changeset
719 while ( 2 )
Ritor1
parents:
diff changeset
720 {
Ritor1
parents:
diff changeset
721 v97 = *((float *)v26 + 7) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
722 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
723 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X;
0
Ritor1
parents:
diff changeset
724 if ( v24 != v27 )
Ritor1
parents:
diff changeset
725 {
Ritor1
parents:
diff changeset
726 v28 = v100;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
727 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X )
0
Ritor1
parents:
diff changeset
728 {
Ritor1
parents:
diff changeset
729 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5));
Ritor1
parents:
diff changeset
730 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4);
Ritor1
parents:
diff changeset
731 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3);
Ritor1
parents:
diff changeset
732 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26;
Ritor1
parents:
diff changeset
733 }
Ritor1
parents:
diff changeset
734 else
Ritor1
parents:
diff changeset
735 {
Ritor1
parents:
diff changeset
736 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7));
Ritor1
parents:
diff changeset
737 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8);
Ritor1
parents:
diff changeset
738 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9);
Ritor1
parents:
diff changeset
739 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12);
Ritor1
parents:
diff changeset
740 }
Ritor1
parents:
diff changeset
741 *(float *)v124 = v30;
Ritor1
parents:
diff changeset
742 *(int *)v133 = LODWORD(v100);
Ritor1
parents:
diff changeset
743 if ( v24 )
Ritor1
parents:
diff changeset
744 {
Ritor1
parents:
diff changeset
745 v32 = *(float *)v122 + 6.7553994e15;
Ritor1
parents:
diff changeset
746 v33 = *((float *)v26 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
747 if ( LODWORD(v32) == LODWORD(v33) )
Ritor1
parents:
diff changeset
748 {
Ritor1
parents:
diff changeset
749 v34 = *(float *)v133 + 6.7553994e15;
Ritor1
parents:
diff changeset
750 v35 = *((float *)v26 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
751 v36 = LODWORD(v34) == LODWORD(v35);
Ritor1
parents:
diff changeset
752 goto LABEL_41;
Ritor1
parents:
diff changeset
753 }
Ritor1
parents:
diff changeset
754 goto LABEL_42;
Ritor1
parents:
diff changeset
755 }
Ritor1
parents:
diff changeset
756 v37 = *(float *)v118 + 6.7553994e15;
Ritor1
parents:
diff changeset
757 v38 = *((float *)v26 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
758 if ( LODWORD(v37) != LODWORD(v38) )
Ritor1
parents:
diff changeset
759 goto LABEL_42;
Ritor1
parents:
diff changeset
760 v39 = *(float *)v129 + 6.7553994e15;
Ritor1
parents:
diff changeset
761 v40 = *((float *)v26 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
762 v36 = LODWORD(v39) == LODWORD(v40);
Ritor1
parents:
diff changeset
763 LABEL_41:
Ritor1
parents:
diff changeset
764 if ( !v36 )
Ritor1
parents:
diff changeset
765 {
Ritor1
parents:
diff changeset
766 LABEL_42:
Ritor1
parents:
diff changeset
767 v129 += 48;
Ritor1
parents:
diff changeset
768 v118 += 48;
Ritor1
parents:
diff changeset
769 v133 += 48;
Ritor1
parents:
diff changeset
770 v122 += 48;
Ritor1
parents:
diff changeset
771 v124 += 48;
Ritor1
parents:
diff changeset
772 v111 += 48;
Ritor1
parents:
diff changeset
773 ++v115;
Ritor1
parents:
diff changeset
774 ++v138;
Ritor1
parents:
diff changeset
775 }
Ritor1
parents:
diff changeset
776 }
Ritor1
parents:
diff changeset
777 if ( v27 )
Ritor1
parents:
diff changeset
778 {
Ritor1
parents:
diff changeset
779 v41 = v138;
Ritor1
parents:
diff changeset
780 ++v115;
Ritor1
parents:
diff changeset
781 v111 += 48;
Ritor1
parents:
diff changeset
782 v124 += 48;
Ritor1
parents:
diff changeset
783 v122 += 48;
Ritor1
parents:
diff changeset
784 v133 += 48;
Ritor1
parents:
diff changeset
785 v118 += 48;
Ritor1
parents:
diff changeset
786 v129 += 48;
Ritor1
parents:
diff changeset
787 ++v138;
Ritor1
parents:
diff changeset
788 memcpy(v41, v26 + 4, 0x30u);
Ritor1
parents:
diff changeset
789 }
Ritor1
parents:
diff changeset
790 v24 = v107;
Ritor1
parents:
diff changeset
791 v26 += 48;
Ritor1
parents:
diff changeset
792 --v110;
Ritor1
parents:
diff changeset
793 if ( v110 )
Ritor1
parents:
diff changeset
794 {
Ritor1
parents:
diff changeset
795 v25 = v111;
Ritor1
parents:
diff changeset
796 continue;
Ritor1
parents:
diff changeset
797 }
Ritor1
parents:
diff changeset
798 break;
Ritor1
parents:
diff changeset
799 }
Ritor1
parents:
diff changeset
800 if ( v115 < 3
Ritor1
parents:
diff changeset
801 || (v123 = 0,
Ritor1
parents:
diff changeset
802 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])),
Ritor1
parents:
diff changeset
803 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15,
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
804 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportTL_Y,
0
Ritor1
parents:
diff changeset
805 v115 < 1) )
Ritor1
parents:
diff changeset
806 goto LABEL_112;
Ritor1
parents:
diff changeset
807 v44 = (char *)&array_508FF0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
808 v130 = array_508FF0;
Ritor1
parents:
diff changeset
809 v119 = (char *)&array_508FF0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
810 v139 = (char *)&array_508FF0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
811 v125 = (char *)&array_508FF0[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
812 v134 = (char *)&array_508FF0[0]._rhw;
0
Ritor1
parents:
diff changeset
813 v45 = (char *)&array_509950[0].flt_2C;
Ritor1
parents:
diff changeset
814 v112 = v115;
Ritor1
parents:
diff changeset
815 while ( 2 )
Ritor1
parents:
diff changeset
816 {
Ritor1
parents:
diff changeset
817 v98 = *((float *)v45 + 8) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
818 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
819 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y;
0
Ritor1
parents:
diff changeset
820 if ( v43 != v46 )
Ritor1
parents:
diff changeset
821 {
Ritor1
parents:
diff changeset
822 v47 = v104;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
823 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y )
0
Ritor1
parents:
diff changeset
824 {
Ritor1
parents:
diff changeset
825 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4));
Ritor1
parents:
diff changeset
826 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5);
Ritor1
parents:
diff changeset
827 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3);
Ritor1
parents:
diff changeset
828 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45;
Ritor1
parents:
diff changeset
829 }
Ritor1
parents:
diff changeset
830 else
Ritor1
parents:
diff changeset
831 {
Ritor1
parents:
diff changeset
832 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8));
Ritor1
parents:
diff changeset
833 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7);
Ritor1
parents:
diff changeset
834 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9);
Ritor1
parents:
diff changeset
835 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12);
Ritor1
parents:
diff changeset
836 }
Ritor1
parents:
diff changeset
837 *(float *)v125 = v49;
Ritor1
parents:
diff changeset
838 *(float *)v139 = v104;
Ritor1
parents:
diff changeset
839 if ( v43 )
Ritor1
parents:
diff changeset
840 {
Ritor1
parents:
diff changeset
841 v51 = v104 + 6.7553994e15;
Ritor1
parents:
diff changeset
842 v52 = *((float *)v45 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
843 if ( LODWORD(v51) == LODWORD(v52) )
Ritor1
parents:
diff changeset
844 {
Ritor1
parents:
diff changeset
845 v53 = *(float *)v44 + 6.7553994e15;
Ritor1
parents:
diff changeset
846 v54 = *((float *)v45 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
847 v55 = LODWORD(v53) == LODWORD(v54);
Ritor1
parents:
diff changeset
848 goto LABEL_58;
Ritor1
parents:
diff changeset
849 }
Ritor1
parents:
diff changeset
850 goto LABEL_59;
Ritor1
parents:
diff changeset
851 }
Ritor1
parents:
diff changeset
852 v56 = v104 + 6.7553994e15;
Ritor1
parents:
diff changeset
853 v57 = *((float *)v45 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
854 if ( LODWORD(v56) != LODWORD(v57) )
Ritor1
parents:
diff changeset
855 goto LABEL_59;
Ritor1
parents:
diff changeset
856 v58 = *(float *)v44 + 6.7553994e15;
Ritor1
parents:
diff changeset
857 v59 = *((float *)v45 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
858 v55 = LODWORD(v58) == LODWORD(v59);
Ritor1
parents:
diff changeset
859 LABEL_58:
Ritor1
parents:
diff changeset
860 if ( !v55 )
Ritor1
parents:
diff changeset
861 {
Ritor1
parents:
diff changeset
862 LABEL_59:
Ritor1
parents:
diff changeset
863 v139 += 48;
Ritor1
parents:
diff changeset
864 v125 += 48;
Ritor1
parents:
diff changeset
865 v134 += 48;
Ritor1
parents:
diff changeset
866 v44 += 48;
Ritor1
parents:
diff changeset
867 ++v123;
Ritor1
parents:
diff changeset
868 ++v130;
Ritor1
parents:
diff changeset
869 v119 = v44;
Ritor1
parents:
diff changeset
870 }
Ritor1
parents:
diff changeset
871 }
Ritor1
parents:
diff changeset
872 if ( v46 )
Ritor1
parents:
diff changeset
873 {
Ritor1
parents:
diff changeset
874 v60 = v130;
Ritor1
parents:
diff changeset
875 v119 += 48;
Ritor1
parents:
diff changeset
876 ++v123;
Ritor1
parents:
diff changeset
877 v134 += 48;
Ritor1
parents:
diff changeset
878 v125 += 48;
Ritor1
parents:
diff changeset
879 v139 += 48;
Ritor1
parents:
diff changeset
880 ++v130;
Ritor1
parents:
diff changeset
881 memcpy(v60, v45 + 4, 0x30u);
Ritor1
parents:
diff changeset
882 v44 = v119;
Ritor1
parents:
diff changeset
883 }
Ritor1
parents:
diff changeset
884 v43 = v108;
Ritor1
parents:
diff changeset
885 v45 += 48;
Ritor1
parents:
diff changeset
886 --v112;
Ritor1
parents:
diff changeset
887 if ( v112 )
Ritor1
parents:
diff changeset
888 continue;
Ritor1
parents:
diff changeset
889 break;
Ritor1
parents:
diff changeset
890 }
Ritor1
parents:
diff changeset
891 if ( v123 < 3
Ritor1
parents:
diff changeset
892 || (v116 = 0,
Ritor1
parents:
diff changeset
893 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])),
Ritor1
parents:
diff changeset
894 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15,
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
895 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportBR_Y,
0
Ritor1
parents:
diff changeset
896 v123 < 1) )
Ritor1
parents:
diff changeset
897 goto LABEL_112;
Ritor1
parents:
diff changeset
898 v63 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
899 v131 = array_508690;
Ritor1
parents:
diff changeset
900 v120 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
901 v140 = (char *)&array_508690[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
902 v126 = (char *)&array_508690[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
903 v135 = (char *)&array_508690[0]._rhw;
0
Ritor1
parents:
diff changeset
904 v64 = (char *)&array_508FF0[0].flt_2C;
Ritor1
parents:
diff changeset
905 v113 = v123;
Ritor1
parents:
diff changeset
906 while ( 2 )
Ritor1
parents:
diff changeset
907 {
Ritor1
parents:
diff changeset
908 v99 = *((float *)v64 + 8) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
909 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y;
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
910 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y;
0
Ritor1
parents:
diff changeset
911 if ( v62 != v65 )
Ritor1
parents:
diff changeset
912 {
Ritor1
parents:
diff changeset
913 v66 = v102;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
914 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y )
0
Ritor1
parents:
diff changeset
915 {
Ritor1
parents:
diff changeset
916 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4));
Ritor1
parents:
diff changeset
917 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5);
Ritor1
parents:
diff changeset
918 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3);
Ritor1
parents:
diff changeset
919 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64;
Ritor1
parents:
diff changeset
920 }
Ritor1
parents:
diff changeset
921 else
Ritor1
parents:
diff changeset
922 {
Ritor1
parents:
diff changeset
923 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8));
Ritor1
parents:
diff changeset
924 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7);
Ritor1
parents:
diff changeset
925 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9);
Ritor1
parents:
diff changeset
926 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12);
Ritor1
parents:
diff changeset
927 }
Ritor1
parents:
diff changeset
928 *(float *)v126 = v68;
Ritor1
parents:
diff changeset
929 *(float *)v140 = v102;
Ritor1
parents:
diff changeset
930 if ( v62 )
Ritor1
parents:
diff changeset
931 {
Ritor1
parents:
diff changeset
932 v70 = v102 + 6.7553994e15;
Ritor1
parents:
diff changeset
933 v71 = *((float *)v64 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
934 if ( LODWORD(v70) == LODWORD(v71) )
Ritor1
parents:
diff changeset
935 {
Ritor1
parents:
diff changeset
936 v72 = *(float *)v63 + 6.7553994e15;
Ritor1
parents:
diff changeset
937 v73 = *((float *)v64 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
938 v74 = LODWORD(v72) == LODWORD(v73);
Ritor1
parents:
diff changeset
939 goto LABEL_75;
Ritor1
parents:
diff changeset
940 }
Ritor1
parents:
diff changeset
941 goto LABEL_76;
Ritor1
parents:
diff changeset
942 }
Ritor1
parents:
diff changeset
943 v75 = v102 + 6.7553994e15;
Ritor1
parents:
diff changeset
944 v76 = *((float *)v64 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
945 if ( LODWORD(v75) != LODWORD(v76) )
Ritor1
parents:
diff changeset
946 goto LABEL_76;
Ritor1
parents:
diff changeset
947 v77 = *(float *)v63 + 6.7553994e15;
Ritor1
parents:
diff changeset
948 v78 = *((float *)v64 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
949 v74 = LODWORD(v77) == LODWORD(v78);
Ritor1
parents:
diff changeset
950 LABEL_75:
Ritor1
parents:
diff changeset
951 if ( !v74 )
Ritor1
parents:
diff changeset
952 {
Ritor1
parents:
diff changeset
953 LABEL_76:
Ritor1
parents:
diff changeset
954 v140 += 48;
Ritor1
parents:
diff changeset
955 v126 += 48;
Ritor1
parents:
diff changeset
956 v135 += 48;
Ritor1
parents:
diff changeset
957 v63 += 48;
Ritor1
parents:
diff changeset
958 ++v116;
Ritor1
parents:
diff changeset
959 ++v131;
Ritor1
parents:
diff changeset
960 v120 = v63;
Ritor1
parents:
diff changeset
961 }
Ritor1
parents:
diff changeset
962 }
Ritor1
parents:
diff changeset
963 if ( v65 )
Ritor1
parents:
diff changeset
964 {
Ritor1
parents:
diff changeset
965 v79 = v131;
Ritor1
parents:
diff changeset
966 v120 += 48;
Ritor1
parents:
diff changeset
967 ++v116;
Ritor1
parents:
diff changeset
968 v135 += 48;
Ritor1
parents:
diff changeset
969 v126 += 48;
Ritor1
parents:
diff changeset
970 v140 += 48;
Ritor1
parents:
diff changeset
971 ++v131;
Ritor1
parents:
diff changeset
972 memcpy(v79, v64 + 4, 0x30u);
Ritor1
parents:
diff changeset
973 v63 = v120;
Ritor1
parents:
diff changeset
974 }
Ritor1
parents:
diff changeset
975 v62 = v109;
Ritor1
parents:
diff changeset
976 v64 += 48;
Ritor1
parents:
diff changeset
977 --v113;
Ritor1
parents:
diff changeset
978 if ( v113 )
Ritor1
parents:
diff changeset
979 continue;
Ritor1
parents:
diff changeset
980 break;
Ritor1
parents:
diff changeset
981 }
Ritor1
parents:
diff changeset
982 if ( v116 < 3 )
Ritor1
parents:
diff changeset
983 goto LABEL_112;
Ritor1
parents:
diff changeset
984 v80 = v116;
Ritor1
parents:
diff changeset
985 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116]));
Ritor1
parents:
diff changeset
986 if ( v116 > 0 )
Ritor1
parents:
diff changeset
987 {
Ritor1
parents:
diff changeset
988 v81 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
989 v82 = v116;
Ritor1
parents:
diff changeset
990 do
Ritor1
parents:
diff changeset
991 {
Ritor1
parents:
diff changeset
992 LODWORD(v83) = *(int *)v81;
Ritor1
parents:
diff changeset
993 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2);
Ritor1
parents:
diff changeset
994 v84 = v83 + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
995 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportBR_X )
0
Ritor1
parents:
diff changeset
996 {
Ritor1
parents:
diff changeset
997 v86 = *(float *)v81 + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
998 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportTL_X )
0
Ritor1
parents:
diff changeset
999 goto LABEL_88;
Ritor1
parents:
diff changeset
1000 v85 = v101;
Ritor1
parents:
diff changeset
1001 }
Ritor1
parents:
diff changeset
1002 else
Ritor1
parents:
diff changeset
1003 {
Ritor1
parents:
diff changeset
1004 v85 = v100;
Ritor1
parents:
diff changeset
1005 }
Ritor1
parents:
diff changeset
1006 *(int *)v81 = LODWORD(v85);
Ritor1
parents:
diff changeset
1007 LABEL_88:
Ritor1
parents:
diff changeset
1008 v87 = *((float *)v81 + 1) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
1009 if ( SLODWORD(v87) > (signed int)pViewport->uViewportBR_Y )
0
Ritor1
parents:
diff changeset
1010 {
Ritor1
parents:
diff changeset
1011 v88 = v102;
Ritor1
parents:
diff changeset
1012 LABEL_92:
Ritor1
parents:
diff changeset
1013 *((int *)v81 + 1) = LODWORD(v88);
Ritor1
parents:
diff changeset
1014 goto LABEL_93;
Ritor1
parents:
diff changeset
1015 }
Ritor1
parents:
diff changeset
1016 v89 = *((float *)v81 + 1) + 6.7553994e15;
693
e0a1fccc89b1 map render fixes
Gloval
parents: 692
diff changeset
1017 if ( SLODWORD(v89) < (signed int)pViewport->uViewportTL_Y )
0
Ritor1
parents:
diff changeset
1018 {
Ritor1
parents:
diff changeset
1019 v88 = v104;
Ritor1
parents:
diff changeset
1020 goto LABEL_92;
Ritor1
parents:
diff changeset
1021 }
Ritor1
parents:
diff changeset
1022 LABEL_93:
Ritor1
parents:
diff changeset
1023 v81 += 48;
Ritor1
parents:
diff changeset
1024 --v82;
Ritor1
parents:
diff changeset
1025 }
Ritor1
parents:
diff changeset
1026 while ( v82 );
Ritor1
parents:
diff changeset
1027 }
Ritor1
parents:
diff changeset
1028 v91 = __OFSUB__(v116, 3);
Ritor1
parents:
diff changeset
1029 v90 = v116 - 3 < 0;
Ritor1
parents:
diff changeset
1030 if ( v116 > 3 )
Ritor1
parents:
diff changeset
1031 {
Ritor1
parents:
diff changeset
1032 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1]));
Ritor1
parents:
diff changeset
1033 if ( v116 > 0 )
Ritor1
parents:
diff changeset
1034 {
Ritor1
parents:
diff changeset
1035 v105 = 1;
Ritor1
parents:
diff changeset
1036 do
Ritor1
parents:
diff changeset
1037 {
Ritor1
parents:
diff changeset
1038 v92 = v105;
Ritor1
parents:
diff changeset
1039 v93 = v105 - 1;
Ritor1
parents:
diff changeset
1040 v94 = v105 + 1;
Ritor1
parents:
diff changeset
1041 v95 = v105 + 1;
Ritor1
parents:
diff changeset
1042 if ( v105 - 1 >= v80 )
Ritor1
parents:
diff changeset
1043 v93 -= v80;
Ritor1
parents:
diff changeset
1044 if ( v105 >= v80 )
Ritor1
parents:
diff changeset
1045 v92 = v105 - v80;
Ritor1
parents:
diff changeset
1046 if ( v94 >= v80 )
Ritor1
parents:
diff changeset
1047 v95 = v94 - v80;
Ritor1
parents:
diff changeset
1048 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX)
Ritor1
parents:
diff changeset
1049 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY)
Ritor1
parents:
diff changeset
1050 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX)
Ritor1
parents:
diff changeset
1051 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 )
Ritor1
parents:
diff changeset
1052 {
Ritor1
parents:
diff changeset
1053 ++v105;
Ritor1
parents:
diff changeset
1054 }
Ritor1
parents:
diff changeset
1055 else
Ritor1
parents:
diff changeset
1056 {
Ritor1
parents:
diff changeset
1057 v96 = v105;
Ritor1
parents:
diff changeset
1058 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) )
Ritor1
parents:
diff changeset
1059 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2));
Ritor1
parents:
diff changeset
1060 --v80;
Ritor1
parents:
diff changeset
1061 }
Ritor1
parents:
diff changeset
1062 }
Ritor1
parents:
diff changeset
1063 while ( v105 - 1 < v80 );
Ritor1
parents:
diff changeset
1064 }
Ritor1
parents:
diff changeset
1065 v91 = __OFSUB__(v80, 3);
Ritor1
parents:
diff changeset
1066 v90 = v80 - 3 < 0;
Ritor1
parents:
diff changeset
1067 }
Ritor1
parents:
diff changeset
1068 if ( v90 ^ v91 )
Ritor1
parents:
diff changeset
1069 LABEL_112:
Ritor1
parents:
diff changeset
1070 result = 0;
Ritor1
parents:
diff changeset
1071 else
Ritor1
parents:
diff changeset
1072 result = v80;
Ritor1
parents:
diff changeset
1073 return result;
Ritor1
parents:
diff changeset
1074 }
Ritor1
parents:
diff changeset
1075
Ritor1
parents:
diff changeset
1076 //----- (0042620A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1077 bool __thiscall sr_42620A(RenderVertexSoft *p)
Ritor1
parents:
diff changeset
1078 {
Ritor1
parents:
diff changeset
1079 __int16 v1; // fps@1
Ritor1
parents:
diff changeset
1080 unsigned __int8 v2; // c0@2
Ritor1
parents:
diff changeset
1081 char v3; // c2@2
Ritor1
parents:
diff changeset
1082 unsigned __int8 v4; // c3@2
Ritor1
parents:
diff changeset
1083 bool result; // eax@2
Ritor1
parents:
diff changeset
1084 unsigned __int8 v6; // c0@4
Ritor1
parents:
diff changeset
1085 char v7; // c2@4
Ritor1
parents:
diff changeset
1086 unsigned __int8 v8; // c3@4
Ritor1
parents:
diff changeset
1087 unsigned __int8 v9; // c0@6
Ritor1
parents:
diff changeset
1088 char v10; // c2@6
Ritor1
parents:
diff changeset
1089 unsigned __int8 v11; // c3@6
Ritor1
parents:
diff changeset
1090 double v12; // st6@7
Ritor1
parents:
diff changeset
1091 float v13; // ST04_4@7
Ritor1
parents:
diff changeset
1092 float v14; // ST00_4@7
Ritor1
parents:
diff changeset
1093 double v15; // st7@7
Ritor1
parents:
diff changeset
1094 double v16; // st6@8
Ritor1
parents:
diff changeset
1095 float v17; // ST04_4@8
Ritor1
parents:
diff changeset
1096 float v18; // ST00_4@8
Ritor1
parents:
diff changeset
1097 double v19; // st7@8
Ritor1
parents:
diff changeset
1098
Ritor1
parents:
diff changeset
1099 //UNDEF(v1);
Ritor1
parents:
diff changeset
1100 if ( p->vWorldViewPosition.x < 300.0
Ritor1
parents:
diff changeset
1101 || (v2 = 300.0 < p[1].vWorldViewPosition.x,
Ritor1
parents:
diff changeset
1102 v3 = 0,
Ritor1
parents:
diff changeset
1103 v4 = 300.0 == p[1].vWorldViewPosition.x,
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1104 //BYTE1(result) = HIBYTE(v1),
0
Ritor1
parents:
diff changeset
1105 !(v2 | v4)) )
Ritor1
parents:
diff changeset
1106 {
Ritor1
parents:
diff changeset
1107 if ( p->vWorldViewPosition.x < 300.0 )
Ritor1
parents:
diff changeset
1108 {
Ritor1
parents:
diff changeset
1109 v6 = 300.0 < p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1110 v7 = 0;
Ritor1
parents:
diff changeset
1111 v8 = 300.0 == p[1].vWorldViewPosition.x;
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1112 //BYTE1(result) = HIBYTE(v1);
0
Ritor1
parents:
diff changeset
1113 if ( !(v6 | v8) )
Ritor1
parents:
diff changeset
1114 {
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1115 //LOBYTE(result) = 0;
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1116 return false;
0
Ritor1
parents:
diff changeset
1117 }
Ritor1
parents:
diff changeset
1118 }
Ritor1
parents:
diff changeset
1119 v9 = 300.0 < p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1120 v10 = 0;
Ritor1
parents:
diff changeset
1121 v11 = 300.0 == p->vWorldViewPosition.x;
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1122 //BYTE1(result) = HIBYTE(v1);
0
Ritor1
parents:
diff changeset
1123 if ( v9 | v11 )
Ritor1
parents:
diff changeset
1124 {
Ritor1
parents:
diff changeset
1125 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x);
Ritor1
parents:
diff changeset
1126 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16;
Ritor1
parents:
diff changeset
1127 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16;
Ritor1
parents:
diff changeset
1128 v19 = 300.0 - p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1129 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1130 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
1131 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
1132 }
Ritor1
parents:
diff changeset
1133 else
Ritor1
parents:
diff changeset
1134 {
Ritor1
parents:
diff changeset
1135 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x);
Ritor1
parents:
diff changeset
1136 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12;
Ritor1
parents:
diff changeset
1137 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12;
Ritor1
parents:
diff changeset
1138 v15 = 300.0 - p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1139 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1140 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y;
Ritor1
parents:
diff changeset
1141 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z;
Ritor1
parents:
diff changeset
1142 }
Ritor1
parents:
diff changeset
1143 }
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1144 //LOBYTE(result) = 1;
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
1145 return true;
0
Ritor1
parents:
diff changeset
1146 }
Ritor1
parents:
diff changeset
1147
Ritor1
parents:
diff changeset
1148 //----- (004268E3) --------------------------------------------------------
Ritor1
parents:
diff changeset
1149 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor)
Ritor1
parents:
diff changeset
1150 {
Ritor1
parents:
diff changeset
1151 unsigned int v1; // eax@1
Ritor1
parents:
diff changeset
1152 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
1153 int v3; // eax@1
Ritor1
parents:
diff changeset
1154 int v4; // edx@1
Ritor1
parents:
diff changeset
1155 unsigned int v5; // ecx@1
Ritor1
parents:
diff changeset
1156
Ritor1
parents:
diff changeset
1157 v1 = uColor >> 9;
Ritor1
parents:
diff changeset
1158 v2 = uColor >> 6;
Ritor1
parents:
diff changeset
1159 LOWORD(v1) = (uColor >> 9) & 0x7C00;
Ritor1
parents:
diff changeset
1160 LOWORD(v2) = (uColor >> 6) & 0x3E0;
Ritor1
parents:
diff changeset
1161 v3 = v2 | v1;
Ritor1
parents:
diff changeset
1162 v4 = (unsigned __int8)uColor >> 3;
Ritor1
parents:
diff changeset
1163 v5 = uColor >> 16;
Ritor1
parents:
diff changeset
1164 LOWORD(v5) = v5 & 0x8000;
Ritor1
parents:
diff changeset
1165 return v5 | v4 | v3;
Ritor1
parents:
diff changeset
1166 }
Ritor1
parents:
diff changeset
1167
Ritor1
parents:
diff changeset
1168 //----- (0042690D) --------------------------------------------------------
Ritor1
parents:
diff changeset
1169 int __fastcall _42690D_colors_cvt(unsigned int a1)
Ritor1
parents:
diff changeset
1170 {
Ritor1
parents:
diff changeset
1171 unsigned int v1; // eax@1
Ritor1
parents:
diff changeset
1172 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
1173
Ritor1
parents:
diff changeset
1174 v1 = a1 >> 8;
Ritor1
parents:
diff changeset
1175 v2 = a1 >> 5;
Ritor1
parents:
diff changeset
1176 LOWORD(v1) = (a1 >> 8) & 0xF800;
Ritor1
parents:
diff changeset
1177 LOWORD(v2) = (a1 >> 5) & 0x7E0;
Ritor1
parents:
diff changeset
1178 return ((unsigned __int8)a1 >> 3) | v2 | v1;
Ritor1
parents:
diff changeset
1179 }
Ritor1
parents:
diff changeset
1180 //----- (00426947) --------------------------------------------------------
Ritor1
parents:
diff changeset
1181 void __cdecl sub_426947()
Ritor1
parents:
diff changeset
1182 {
893
4676774b225c GuildDialogue fix
Ritor1
parents: 890
diff changeset
1183 stru_50C198.field_0 = 0;
0
Ritor1
parents:
diff changeset
1184 dword_50C994 = 0;
Ritor1
parents:
diff changeset
1185 dword_50C998_turnbased_icon_1A = 0;
Ritor1
parents:
diff changeset
1186 }
Ritor1
parents:
diff changeset
1187 // 50C968: using guessed type int dword_50C968;
Ritor1
parents:
diff changeset
1188 // 50C994: using guessed type int dword_50C994;
Ritor1
parents:
diff changeset
1189 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
Ritor1
parents:
diff changeset
1190
Ritor1
parents:
diff changeset
1191 //----- (004269A2) --------------------------------------------------------
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1192 void __fastcall GivePartyExp(unsigned int pEXPNum)
0
Ritor1
parents:
diff changeset
1193 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1194 signed int pActivePlayerCount; // ecx@1
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1195 int pLearningPercent; // eax@13
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1196
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1197 pActivePlayerCount = 0;
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1198 for ( uint i = 0; i < 4; ++i )
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1199 {
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1200 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] )
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1201 pActivePlayerCount ++;
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1202 }
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1203 if ( pActivePlayerCount )
0
Ritor1
parents:
diff changeset
1204 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1205 pEXPNum = pEXPNum / pActivePlayerCount;
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1206 for ( uint i = 0; i < 4; ++i )
0
Ritor1
parents:
diff changeset
1207 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1208 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] )
0
Ritor1
parents:
diff changeset
1209 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1210 if ( pEXPNum )
0
Ritor1
parents:
diff changeset
1211 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1212 pLearningPercent = pParty->pPlayers[i].GetLearningPercent();
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1213 pEXPNum = pEXPNum + pEXPNum * pLearningPercent / 100;
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1214 pParty->pPlayers[i].uExperience += pEXPNum;
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1215 if ( pParty->pPlayers[i].uExperience > 4000000000i64 )
0
Ritor1
parents:
diff changeset
1216 {
958
9c2d08e42ed3 GivePartyExp
Ritor1
parents: 951
diff changeset
1217 pParty->pPlayers[i].uExperience = 0;
0
Ritor1
parents:
diff changeset
1218 }
Ritor1
parents:
diff changeset
1219 }
Ritor1
parents:
diff changeset
1220 }
Ritor1
parents:
diff changeset
1221 }
Ritor1
parents:
diff changeset
1222 }
Ritor1
parents:
diff changeset
1223 }
Ritor1
parents:
diff changeset
1224
Ritor1
parents:
diff changeset
1225 //----- (00426A5A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1226 void stru319::LootActor(Actor *pActor)
Ritor1
parents:
diff changeset
1227 {
Ritor1
parents:
diff changeset
1228 signed int v2; // edi@1
Ritor1
parents:
diff changeset
1229 char v3; // zf@1
Ritor1
parents:
diff changeset
1230 unsigned int v4; // eax@13
Ritor1
parents:
diff changeset
1231 unsigned int v5; // esi@13
Ritor1
parents:
diff changeset
1232 int v6; // eax@14
Ritor1
parents:
diff changeset
1233 unsigned __int8 v7; // al@30
Ritor1
parents:
diff changeset
1234 Party *v8; // esi@34
Ritor1
parents:
diff changeset
1235 char *v9; // [sp-4h] [bp-3Ch]@10
Ritor1
parents:
diff changeset
1236 char *v10; // [sp-4h] [bp-3Ch]@31
Ritor1
parents:
diff changeset
1237 char *v11; // [sp-4h] [bp-3Ch]@38
Ritor1
parents:
diff changeset
1238 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1
Ritor1
parents:
diff changeset
1239 int v13; // [sp+30h] [bp-8h]@1
Ritor1
parents:
diff changeset
1240 int v14; // [sp+34h] [bp-4h]@1
Ritor1
parents:
diff changeset
1241
Ritor1
parents:
diff changeset
1242 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1243 Dst.Reset();
Ritor1
parents:
diff changeset
1244 v2 = 0;
Ritor1
parents:
diff changeset
1245 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0;
Ritor1
parents:
diff changeset
1246 v13 = 0;
Ritor1
parents:
diff changeset
1247 v14 = 0;
Ritor1
parents:
diff changeset
1248 if ( v3 )
Ritor1
parents:
diff changeset
1249 {
Ritor1
parents:
diff changeset
1250 if ( !pActor->pMonsterInfo.uTreasureDiceRolls )
Ritor1
parents:
diff changeset
1251 goto LABEL_9;
Ritor1
parents:
diff changeset
1252 do
Ritor1
parents:
diff changeset
1253 {
Ritor1
parents:
diff changeset
1254 ++v2;
Ritor1
parents:
diff changeset
1255 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1;
Ritor1
parents:
diff changeset
1256 }
Ritor1
parents:
diff changeset
1257 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls );
Ritor1
parents:
diff changeset
1258 }
Ritor1
parents:
diff changeset
1259 else
Ritor1
parents:
diff changeset
1260 {
Ritor1
parents:
diff changeset
1261 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 )
Ritor1
parents:
diff changeset
1262 goto LABEL_9;
377
243418228760 GetIdentifiedName
Gloval
parents: 370
diff changeset
1263 v14 = pActor->array_000234[3].uSpecEnchantmentType;
0
Ritor1
parents:
diff changeset
1264 pActor->array_000234[3].Reset();
Ritor1
parents:
diff changeset
1265 }
Ritor1
parents:
diff changeset
1266 if ( v14 )
Ritor1
parents:
diff changeset
1267 {
Ritor1
parents:
diff changeset
1268 party_finds_gold(v14, 0);
Ritor1
parents:
diff changeset
1269 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
1270 }
Ritor1
parents:
diff changeset
1271 LABEL_9:
Ritor1
parents:
diff changeset
1272 if ( pActor->uCarriedItemID )
Ritor1
parents:
diff changeset
1273 {
Ritor1
parents:
diff changeset
1274 Dst.Reset();
Ritor1
parents:
diff changeset
1275 Dst.uItemID = pActor->uCarriedItemID;
Ritor1
parents:
diff changeset
1276 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1277 if ( v14 )
721
Ritor1
parents: 693
diff changeset
1278 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9);
0
Ritor1
parents:
diff changeset
1279 else
721
Ritor1
parents: 693
diff changeset
1280 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9);
0
Ritor1
parents:
diff changeset
1281 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1282 v4 = Dst.uItemID;
Ritor1
parents:
diff changeset
1283 v5 = Dst.uItemID;
Ritor1
parents:
diff changeset
1284 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 )
Ritor1
parents:
diff changeset
1285 {
Ritor1
parents:
diff changeset
1286 v5 = Dst.uItemID;
Ritor1
parents:
diff changeset
1287 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1;
Ritor1
parents:
diff changeset
1288 Dst.uNumCharges = v6;
Ritor1
parents:
diff changeset
1289 Dst.uMaxCharges = v6;
Ritor1
parents:
diff changeset
1290 v4 = Dst.uItemID;
Ritor1
parents:
diff changeset
1291 }
Ritor1
parents:
diff changeset
1292 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 569
diff changeset
1293 Dst.uEnchantmentType = 2 * rand() % 4 + 2;
0
Ritor1
parents:
diff changeset
1294 pItemsTable->SetSpecialBonus(&Dst);
Ritor1
parents:
diff changeset
1295 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1296 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1297 pActor->uCarriedItemID = 0;
Ritor1
parents:
diff changeset
1298 if ( pActor->array_000234[0].uItemID )
Ritor1
parents:
diff changeset
1299 {
Ritor1
parents:
diff changeset
1300 if ( !pParty->AddItem(pActor->array_000234) )
Ritor1
parents:
diff changeset
1301 {
Ritor1
parents:
diff changeset
1302 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1303 pParty->SetHoldingItem(pActor->array_000234);
Ritor1
parents:
diff changeset
1304 }
Ritor1
parents:
diff changeset
1305 pActor->array_000234[0].Reset();
Ritor1
parents:
diff changeset
1306 }
Ritor1
parents:
diff changeset
1307 if ( pActor->array_000234[1].uItemID )
Ritor1
parents:
diff changeset
1308 {
Ritor1
parents:
diff changeset
1309 if ( !pParty->AddItem(&pActor->array_000234[1]) )
Ritor1
parents:
diff changeset
1310 {
Ritor1
parents:
diff changeset
1311 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1312 pParty->SetHoldingItem(&pActor->array_000234[1]);
Ritor1
parents:
diff changeset
1313 }
Ritor1
parents:
diff changeset
1314 pActor->array_000234[1].Reset();
Ritor1
parents:
diff changeset
1315 }
Ritor1
parents:
diff changeset
1316 LABEL_55:
Ritor1
parents:
diff changeset
1317 pActor->Remove();
Ritor1
parents:
diff changeset
1318 return;
Ritor1
parents:
diff changeset
1319 }
Ritor1
parents:
diff changeset
1320 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes )
Ritor1
parents:
diff changeset
1321 {
Ritor1
parents:
diff changeset
1322 if ( pActor->array_000234[3].uItemID )
Ritor1
parents:
diff changeset
1323 {
Ritor1
parents:
diff changeset
1324 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst));
Ritor1
parents:
diff changeset
1325 pActor->array_000234[3].Reset();
Ritor1
parents:
diff changeset
1326 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1327 if ( v14 )
721
Ritor1
parents: 693
diff changeset
1328 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11);
0
Ritor1
parents:
diff changeset
1329 else
721
Ritor1
parents: 693
diff changeset
1330 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11);
0
Ritor1
parents:
diff changeset
1331 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1332 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1333 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1334 v13 = 1;
Ritor1
parents:
diff changeset
1335 }
Ritor1
parents:
diff changeset
1336 goto LABEL_44;
Ritor1
parents:
diff changeset
1337 }
Ritor1
parents:
diff changeset
1338 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 )
Ritor1
parents:
diff changeset
1339 {
Ritor1
parents:
diff changeset
1340 LABEL_44:
Ritor1
parents:
diff changeset
1341 v8 = pParty;
Ritor1
parents:
diff changeset
1342 goto LABEL_45;
Ritor1
parents:
diff changeset
1343 }
Ritor1
parents:
diff changeset
1344 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst);
Ritor1
parents:
diff changeset
1345 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1346 if ( v14 )
721
Ritor1
parents: 693
diff changeset
1347 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10);
0
Ritor1
parents:
diff changeset
1348 else
721
Ritor1
parents: 693
diff changeset
1349 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10);
0
Ritor1
parents:
diff changeset
1350 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1351 v8 = pParty;
Ritor1
parents:
diff changeset
1352 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1353 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1354 v13 = 1;
Ritor1
parents:
diff changeset
1355 LABEL_45:
Ritor1
parents:
diff changeset
1356 if ( pActor->array_000234[0].uItemID )
Ritor1
parents:
diff changeset
1357 {
Ritor1
parents:
diff changeset
1358 if ( !v8->AddItem(pActor->array_000234) )
Ritor1
parents:
diff changeset
1359 {
Ritor1
parents:
diff changeset
1360 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1361 v8->SetHoldingItem(pActor->array_000234);
Ritor1
parents:
diff changeset
1362 v13 = 1;
Ritor1
parents:
diff changeset
1363 }
Ritor1
parents:
diff changeset
1364 pActor->array_000234[0].Reset();
Ritor1
parents:
diff changeset
1365 }
Ritor1
parents:
diff changeset
1366 if ( pActor->array_000234[1].uItemID )
Ritor1
parents:
diff changeset
1367 {
Ritor1
parents:
diff changeset
1368 if ( !v8->AddItem(&pActor->array_000234[1]) )
Ritor1
parents:
diff changeset
1369 {
Ritor1
parents:
diff changeset
1370 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1371 v8->SetHoldingItem(&pActor->array_000234[1]);
Ritor1
parents:
diff changeset
1372 v13 = 1;
Ritor1
parents:
diff changeset
1373 }
Ritor1
parents:
diff changeset
1374 pActor->array_000234[1].Reset();
Ritor1
parents:
diff changeset
1375 }
Ritor1
parents:
diff changeset
1376 if ( !v13 || rand() % 100 < 90 )
Ritor1
parents:
diff changeset
1377 goto LABEL_55;
Ritor1
parents:
diff changeset
1378 }
Ritor1
parents:
diff changeset
1379
Ritor1
parents:
diff changeset
1380 //----- (00426E10) --------------------------------------------------------
Ritor1
parents:
diff changeset
1381 int stru319::which_player_would_attack(Actor *pActor)
Ritor1
parents:
diff changeset
1382 {
Ritor1
parents:
diff changeset
1383 signed int v2; // ebx@1
Ritor1
parents:
diff changeset
1384 int v3; // ecx@2
Ritor1
parents:
diff changeset
1385 signed int v4; // edx@3
Ritor1
parents:
diff changeset
1386 char v5; // zf@3
Ritor1
parents:
diff changeset
1387 unsigned int v6; // eax@3
Ritor1
parents:
diff changeset
1388 int v7; // eax@6
Ritor1
parents:
diff changeset
1389 int v8; // eax@7
Ritor1
parents:
diff changeset
1390 int v9; // eax@8
Ritor1
parents:
diff changeset
1391 int v10; // eax@9
Ritor1
parents:
diff changeset
1392 int v11; // eax@10
Ritor1
parents:
diff changeset
1393 int v12; // eax@11
Ritor1
parents:
diff changeset
1394 int v13; // esi@35
Ritor1
parents:
diff changeset
1395 signed int v14; // edi@37
Ritor1
parents:
diff changeset
1396 enum CHARACTER_RACE v15; // eax@44
Ritor1
parents:
diff changeset
1397 Player *v16; // ecx@47
Ritor1
parents:
diff changeset
1398 unsigned __int8 v17; // sf@50
Ritor1
parents:
diff changeset
1399 unsigned __int8 v18; // of@50
Ritor1
parents:
diff changeset
1400 int v19; // esi@52
Ritor1
parents:
diff changeset
1401 Player *v20; // ecx@53
Ritor1
parents:
diff changeset
1402 int result; // eax@57
Ritor1
parents:
diff changeset
1403 int v22[16]; // [sp+8h] [bp-140h]@3
Ritor1
parents:
diff changeset
1404 int v23[60]; // [sp+48h] [bp-100h]@48
Ritor1
parents:
diff changeset
1405 int v24; // [sp+138h] [bp-10h]@2
Ritor1
parents:
diff changeset
1406 int v25; // [sp+13Ch] [bp-Ch]@1
Ritor1
parents:
diff changeset
1407 int v26; // [sp+140h] [bp-8h]@1
Ritor1
parents:
diff changeset
1408 int v27; // [sp+144h] [bp-4h]@1
Ritor1
parents:
diff changeset
1409
Ritor1
parents:
diff changeset
1410 v27 = -1;
Ritor1
parents:
diff changeset
1411 v26 = -1;
Ritor1
parents:
diff changeset
1412 v25 = -1;
Ritor1
parents:
diff changeset
1413 v2 = 0;
Ritor1
parents:
diff changeset
1414 if ( pActor->pMonsterInfo.uAttackPreference )
Ritor1
parents:
diff changeset
1415 {
Ritor1
parents:
diff changeset
1416 v3 = 0;
Ritor1
parents:
diff changeset
1417 v24 = 0;
Ritor1
parents:
diff changeset
1418 do
Ritor1
parents:
diff changeset
1419 {
Ritor1
parents:
diff changeset
1420 v4 = 1;
Ritor1
parents:
diff changeset
1421 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3);
Ritor1
parents:
diff changeset
1422 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0;
Ritor1
parents:
diff changeset
1423 v22[v3] = v6;
Ritor1
parents:
diff changeset
1424 if ( !v5 )
Ritor1
parents:
diff changeset
1425 {
Ritor1
parents:
diff changeset
1426 if ( (signed int)v6 > 128 )
Ritor1
parents:
diff changeset
1427 {
Ritor1
parents:
diff changeset
1428 switch ( v6 )
Ritor1
parents:
diff changeset
1429 {
Ritor1
parents:
diff changeset
1430 case 0x100u:
Ritor1
parents:
diff changeset
1431 v27 = 8;
Ritor1
parents:
diff changeset
1432 break;
Ritor1
parents:
diff changeset
1433 case 0x200u:
Ritor1
parents:
diff changeset
1434 v25 = 0;
Ritor1
parents:
diff changeset
1435 break;
Ritor1
parents:
diff changeset
1436 case 0x400u:
Ritor1
parents:
diff changeset
1437 v25 = 1;
Ritor1
parents:
diff changeset
1438 break;
Ritor1
parents:
diff changeset
1439 case 0x800u:
Ritor1
parents:
diff changeset
1440 v26 = 0;
Ritor1
parents:
diff changeset
1441 break;
Ritor1
parents:
diff changeset
1442 case 0x1000u:
Ritor1
parents:
diff changeset
1443 v26 = 1;
Ritor1
parents:
diff changeset
1444 break;
Ritor1
parents:
diff changeset
1445 case 0x2000u:
Ritor1
parents:
diff changeset
1446 v26 = 3;
Ritor1
parents:
diff changeset
1447 break;
Ritor1
parents:
diff changeset
1448 case 0x4000u:
Ritor1
parents:
diff changeset
1449 v26 = 2;
Ritor1
parents:
diff changeset
1450 break;
Ritor1
parents:
diff changeset
1451 }
Ritor1
parents:
diff changeset
1452 }
Ritor1
parents:
diff changeset
1453 else
Ritor1
parents:
diff changeset
1454 {
Ritor1
parents:
diff changeset
1455 if ( v6 == 128 )
Ritor1
parents:
diff changeset
1456 {
Ritor1
parents:
diff changeset
1457 v27 = 4;
Ritor1
parents:
diff changeset
1458 }
Ritor1
parents:
diff changeset
1459 else
Ritor1
parents:
diff changeset
1460 {
Ritor1
parents:
diff changeset
1461 v7 = v6 - 1;
Ritor1
parents:
diff changeset
1462 if ( v7 )
Ritor1
parents:
diff changeset
1463 {
Ritor1
parents:
diff changeset
1464 v8 = v7 - 1;
Ritor1
parents:
diff changeset
1465 if ( v8 )
Ritor1
parents:
diff changeset
1466 {
Ritor1
parents:
diff changeset
1467 v9 = v8 - 2;
Ritor1
parents:
diff changeset
1468 if ( v9 )
Ritor1
parents:
diff changeset
1469 {
Ritor1
parents:
diff changeset
1470 v10 = v9 - 4;
Ritor1
parents:
diff changeset
1471 if ( v10 )
Ritor1
parents:
diff changeset
1472 {
Ritor1
parents:
diff changeset
1473 v11 = v10 - 8;
Ritor1
parents:
diff changeset
1474 if ( v11 )
Ritor1
parents:
diff changeset
1475 {
Ritor1
parents:
diff changeset
1476 v12 = v11 - 16;
Ritor1
parents:
diff changeset
1477 if ( v12 )
Ritor1
parents:
diff changeset
1478 {
Ritor1
parents:
diff changeset
1479 if ( v12 == 32 )
Ritor1
parents:
diff changeset
1480 v27 = 20;
Ritor1
parents:
diff changeset
1481 }
Ritor1
parents:
diff changeset
1482 else
Ritor1
parents:
diff changeset
1483 {
Ritor1
parents:
diff changeset
1484 v27 = 32;
Ritor1
parents:
diff changeset
1485 }
Ritor1
parents:
diff changeset
1486 }
Ritor1
parents:
diff changeset
1487 else
Ritor1
parents:
diff changeset
1488 {
Ritor1
parents:
diff changeset
1489 v27 = 24;
Ritor1
parents:
diff changeset
1490 }
Ritor1
parents:
diff changeset
1491 }
Ritor1
parents:
diff changeset
1492 else
Ritor1
parents:
diff changeset
1493 {
Ritor1
parents:
diff changeset
1494 v27 = 28;
Ritor1
parents:
diff changeset
1495 }
Ritor1
parents:
diff changeset
1496 }
Ritor1
parents:
diff changeset
1497 else
Ritor1
parents:
diff changeset
1498 {
Ritor1
parents:
diff changeset
1499 v27 = 16;
Ritor1
parents:
diff changeset
1500 }
Ritor1
parents:
diff changeset
1501 }
Ritor1
parents:
diff changeset
1502 else
Ritor1
parents:
diff changeset
1503 {
Ritor1
parents:
diff changeset
1504 v27 = 12;
Ritor1
parents:
diff changeset
1505 }
Ritor1
parents:
diff changeset
1506 }
Ritor1
parents:
diff changeset
1507 else
Ritor1
parents:
diff changeset
1508 {
Ritor1
parents:
diff changeset
1509 v27 = 0;
Ritor1
parents:
diff changeset
1510 }
Ritor1
parents:
diff changeset
1511 }
Ritor1
parents:
diff changeset
1512 }
Ritor1
parents:
diff changeset
1513 v2 = 0;
Ritor1
parents:
diff changeset
1514 v13 = 0;
Ritor1
parents:
diff changeset
1515 while ( 1 )
Ritor1
parents:
diff changeset
1516 {
Ritor1
parents:
diff changeset
1517 v14 = 0;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 112
diff changeset
1518 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType )
0
Ritor1
parents:
diff changeset
1519 v14 = v4;
Ritor1
parents:
diff changeset
1520 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex )
Ritor1
parents:
diff changeset
1521 v14 = v4;
Ritor1
parents:
diff changeset
1522 if ( v26 != -1 )
Ritor1
parents:
diff changeset
1523 {
Ritor1
parents:
diff changeset
1524 v15 = pPlayers[v13 + 1]->GetRace();
Ritor1
parents:
diff changeset
1525 if ( v26 == v15 )
Ritor1
parents:
diff changeset
1526 v14 = 1;
Ritor1
parents:
diff changeset
1527 }
Ritor1
parents:
diff changeset
1528 if ( v14 == 1 )
Ritor1
parents:
diff changeset
1529 {
Ritor1
parents:
diff changeset
1530 v16 = pPlayers[v13 + 1];
Ritor1
parents:
diff changeset
1531 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) )
Ritor1
parents:
diff changeset
1532 v23[v2++] = v13;
Ritor1
parents:
diff changeset
1533 }
Ritor1
parents:
diff changeset
1534 ++v13;
Ritor1
parents:
diff changeset
1535 if ( v13 >= 4 )
Ritor1
parents:
diff changeset
1536 break;
Ritor1
parents:
diff changeset
1537 v4 = 1;
Ritor1
parents:
diff changeset
1538 }
Ritor1
parents:
diff changeset
1539 }
Ritor1
parents:
diff changeset
1540 v3 = v24 + 1;
Ritor1
parents:
diff changeset
1541 v18 = __OFSUB__(v24 + 1, 15);
Ritor1
parents:
diff changeset
1542 v17 = v24++ - 14 < 0;
Ritor1
parents:
diff changeset
1543 }
Ritor1
parents:
diff changeset
1544 while ( v17 ^ v18 );
Ritor1
parents:
diff changeset
1545 if ( v2 )
Ritor1
parents:
diff changeset
1546 goto LABEL_61;
Ritor1
parents:
diff changeset
1547 }
Ritor1
parents:
diff changeset
1548 v19 = 0;
Ritor1
parents:
diff changeset
1549 do
Ritor1
parents:
diff changeset
1550 {
Ritor1
parents:
diff changeset
1551 v20 = pPlayers[v19 + 1];
Ritor1
parents:
diff changeset
1552 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) )
Ritor1
parents:
diff changeset
1553 v23[v2++] = v19;
Ritor1
parents:
diff changeset
1554 ++v19;
Ritor1
parents:
diff changeset
1555 }
Ritor1
parents:
diff changeset
1556 while ( v19 < 4 );
Ritor1
parents:
diff changeset
1557 if ( v2 )
Ritor1
parents:
diff changeset
1558 LABEL_61:
Ritor1
parents:
diff changeset
1559 result = v23[rand() % v2];
Ritor1
parents:
diff changeset
1560 else
Ritor1
parents:
diff changeset
1561 result = 0;
Ritor1
parents:
diff changeset
1562 return result;
Ritor1
parents:
diff changeset
1563 }
Ritor1
parents:
diff changeset
1564
Ritor1
parents:
diff changeset
1565 //----- (0042704B) --------------------------------------------------------
Ritor1
parents:
diff changeset
1566 bool stru319::special_ability_use_check(Actor *pActor, int a2)
Ritor1
parents:
diff changeset
1567 {
Ritor1
parents:
diff changeset
1568 stru319 *v3; // edi@1
Ritor1
parents:
diff changeset
1569 signed int v4; // ebx@5
Ritor1
parents:
diff changeset
1570 signed int v5; // edi@5
Ritor1
parents:
diff changeset
1571
Ritor1
parents:
diff changeset
1572 v3 = this;
Ritor1
parents:
diff changeset
1573 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2
Ritor1
parents:
diff changeset
1574 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u
Ritor1
parents:
diff changeset
1575 && rand() % 100 < 5 )
Ritor1
parents:
diff changeset
1576 pActor->_44FD29(a2);
Ritor1
parents:
diff changeset
1577 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID);
Ritor1
parents:
diff changeset
1578 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID);
Ritor1
parents:
diff changeset
1579 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance )
Ritor1
parents:
diff changeset
1580 return 2;
Ritor1
parents:
diff changeset
1581 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance )
Ritor1
parents:
diff changeset
1582 return 3;
Ritor1
parents:
diff changeset
1583 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance;
Ritor1
parents:
diff changeset
1584 }
Ritor1
parents:
diff changeset
1585
Ritor1
parents:
diff changeset
1586 //----- (00427102) --------------------------------------------------------
Ritor1
parents:
diff changeset
1587 int stru319::_427102(Actor *pActor, signed int a2)
Ritor1
parents:
diff changeset
1588 {
Ritor1
parents:
diff changeset
1589 unsigned __int8 v3; // cf@11
Ritor1
parents:
diff changeset
1590 unsigned __int8 v4; // zf@11
Ritor1
parents:
diff changeset
1591 SpellBuff *v6; // ecx@46
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1592 Player *v7; // esi@49
0
Ritor1
parents:
diff changeset
1593 signed int v8; // edx@50
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1594 SpellBuff *v9; // ecx@50
0
Ritor1
parents:
diff changeset
1595
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1596 switch(a2)
0
Ritor1
parents:
diff changeset
1597 {
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1598 case 77:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1599 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1600 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1601 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1602 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1603 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1604 case 80:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1605 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1606 v6 = pParty->pPartyBuffs;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1607 while ( (signed __int64)v6->uExpireTime <= 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1608 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1609 ++v6;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1610 if ( v6 > &pParty->pPartyBuffs[19] )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1611 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1612 v7 = pParty->pPlayers;//[0].pPlayerBuffs;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1613 v8 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1614 v9 = v7->pPlayerBuffs;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1615 while ( v9->uExpireTime <= 0i64 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1616 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1617 ++v8;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1618 ++v9;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1619 if ( v8 >= 24 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1620 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1621 ++v7;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1622 if ( v7 <= &pParty->pPlayers[3] )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1623 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1624 v8 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1625 v9 = v7->pPlayerBuffs;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1626 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1627 else
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1628 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1629 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1630 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1631 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1632 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1633 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1634 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1635 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1636 case 85:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1637 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1638 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1639 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1640 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1641 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1642 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1643 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1644 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1645 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1646 case 86:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1647 {
0
Ritor1
parents:
diff changeset
1648 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 )
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1649 return 1;
0
Ritor1
parents:
diff changeset
1650 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 )
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1651 return 0;
0
Ritor1
parents:
diff changeset
1652 v3 = 0;
Ritor1
parents:
diff changeset
1653 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0;
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1654 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1655 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1656 case 95:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1657 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1658 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1659 return 1;
0
Ritor1
parents:
diff changeset
1660 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 )
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1661 return 0;
0
Ritor1
parents:
diff changeset
1662 v3 = 0;
Ritor1
parents:
diff changeset
1663 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0;
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1664 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1665 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1666 case 73:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1667 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1668 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1669 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1670 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1671 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1672 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1673 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1674 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1675 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1676 case 5:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1677 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1678 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1679 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1680 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1681 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1682 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1683 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1684 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1685 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1686 case 17:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1687 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1688 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1689 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1690 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1691 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1692 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1693 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1694 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1695 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1696 case 38:
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1697 {
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1698 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1699 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1700 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1701 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1702 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1703 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1704 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1705 case 46:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1706 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1707 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 )
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1708 return 1;
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1709 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1710 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1711 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1712 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1713 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1714 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1715 case 47:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1716 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1717 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1718 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1719 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1720 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1721 v3 = 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1722 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1723 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1724 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1725 case 51:
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1726 {
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1727 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1728 return 1;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1729 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 )
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1730 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1731 v3 = 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1732 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1733 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1734 else
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1735 return 0;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1736 break;
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1737 }
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1738 default:
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1739 {
597
c03428cb4119 stru319::_427102 clean
zipi
parents: 574
diff changeset
1740 return 1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1741 }
0
Ritor1
parents:
diff changeset
1742 }
Ritor1
parents:
diff changeset
1743 if ( !(v3 | v4) )
Ritor1
parents:
diff changeset
1744 return 0;
Ritor1
parents:
diff changeset
1745 return 1;
Ritor1
parents:
diff changeset
1746 }
Ritor1
parents:
diff changeset
1747
Ritor1
parents:
diff changeset
1748 //----- (004272F5) --------------------------------------------------------
Ritor1
parents:
diff changeset
1749 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4)
Ritor1
parents:
diff changeset
1750 {
Ritor1
parents:
diff changeset
1751 signed int v5; // esi@1
Ritor1
parents:
diff changeset
1752 signed int v6; // edi@1
Ritor1
parents:
diff changeset
1753 int v7; // esi@8
Ritor1
parents:
diff changeset
1754 int v8; // eax@9
Ritor1
parents:
diff changeset
1755 int v9; // edx@11
Ritor1
parents:
diff changeset
1756 int v10; // edx@13
Ritor1
parents:
diff changeset
1757 int v11; // esi@13
Ritor1
parents:
diff changeset
1758 unsigned __int8 v12; // sf@13
Ritor1
parents:
diff changeset
1759 unsigned __int8 v13; // of@13
Ritor1
parents:
diff changeset
1760 int v14; // edx@14
Ritor1
parents:
diff changeset
1761 int v15; // eax@14
Ritor1
parents:
diff changeset
1762 signed int result; // eax@17
Ritor1
parents:
diff changeset
1763
Ritor1
parents:
diff changeset
1764 v5 = pActor->pMonsterInfo.uAC;
Ritor1
parents:
diff changeset
1765 v6 = 0;
Ritor1
parents:
diff changeset
1766 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1767 v5 /= 2;
Ritor1
parents:
diff changeset
1768 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1769 v6 = pActor->pActorBuffs[15].uPower;
Ritor1
parents:
diff changeset
1770 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 )
Ritor1
parents:
diff changeset
1771 v6 = pActor->pActorBuffs[16].uPower;
Ritor1
parents:
diff changeset
1772 v7 = v6 + v5;
Ritor1
parents:
diff changeset
1773 if ( a3 )
Ritor1
parents:
diff changeset
1774 v8 = pPlayer->GetRangedAttack();
Ritor1
parents:
diff changeset
1775 else
Ritor1
parents:
diff changeset
1776 v8 = pPlayer->GetActualAttack(0);
Ritor1
parents:
diff changeset
1777 v9 = rand() % (v7 + 2 * v8 + 30);
Ritor1
parents:
diff changeset
1778 if ( a3 == 2 )
Ritor1
parents:
diff changeset
1779 {
Ritor1
parents:
diff changeset
1780 v14 = a4 + v9;
Ritor1
parents:
diff changeset
1781 v15 = ((v7 + 15) >> 1) + v7 + 15;
Ritor1
parents:
diff changeset
1782 }
Ritor1
parents:
diff changeset
1783 else
Ritor1
parents:
diff changeset
1784 {
Ritor1
parents:
diff changeset
1785 if ( a3 != 3 )
Ritor1
parents:
diff changeset
1786 {
Ritor1
parents:
diff changeset
1787 v10 = a4 + v9;
Ritor1
parents:
diff changeset
1788 v11 = v7 + 15;
Ritor1
parents:
diff changeset
1789 v13 = __OFSUB__(v10, v11);
Ritor1
parents:
diff changeset
1790 v12 = v10 - v11 < 0;
Ritor1
parents:
diff changeset
1791 goto LABEL_16;
Ritor1
parents:
diff changeset
1792 }
Ritor1
parents:
diff changeset
1793 v14 = a4 + v9;
Ritor1
parents:
diff changeset
1794 v15 = 2 * v7 + 30;
Ritor1
parents:
diff changeset
1795 }
Ritor1
parents:
diff changeset
1796 v13 = __OFSUB__(v14, v15);
Ritor1
parents:
diff changeset
1797 v12 = v14 - v15 < 0;
Ritor1
parents:
diff changeset
1798 LABEL_16:
Ritor1
parents:
diff changeset
1799 if ( v12 ^ v13 )
Ritor1
parents:
diff changeset
1800 result = 0;
Ritor1
parents:
diff changeset
1801 else
Ritor1
parents:
diff changeset
1802 result = 1;
Ritor1
parents:
diff changeset
1803 return result;
Ritor1
parents:
diff changeset
1804 }
Ritor1
parents:
diff changeset
1805
Ritor1
parents:
diff changeset
1806 //----- (004273BB) --------------------------------------------------------
Ritor1
parents:
diff changeset
1807 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4)
Ritor1
parents:
diff changeset
1808 {
Ritor1
parents:
diff changeset
1809 Actor *v5; // ecx@1
Ritor1
parents:
diff changeset
1810 signed int v6; // ebx@1
Ritor1
parents:
diff changeset
1811 signed int v7; // esi@1
Ritor1
parents:
diff changeset
1812 unsigned __int8 v8; // zf@1
Ritor1
parents:
diff changeset
1813 unsigned __int8 v9; // sf@1
Ritor1
parents:
diff changeset
1814 int v10; // ebx@10
Ritor1
parents:
diff changeset
1815 signed int a2a; // [sp+18h] [bp+Ch]@1
Ritor1
parents:
diff changeset
1816
Ritor1
parents:
diff changeset
1817 v5 = a2;
Ritor1
parents:
diff changeset
1818 v6 = a2->pMonsterInfo.uAC;
Ritor1
parents:
diff changeset
1819 v7 = 0;
Ritor1
parents:
diff changeset
1820 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1821 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0;
Ritor1
parents:
diff changeset
1822 a2a = 0;
Ritor1
parents:
diff changeset
1823 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) )
Ritor1
parents:
diff changeset
1824 v6 /= 2;
Ritor1
parents:
diff changeset
1825 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1826 v7 = v5->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1827 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 )
Ritor1
parents:
diff changeset
1828 v7 = v5->pActorBuffs[16].uPower;
Ritor1
parents:
diff changeset
1829 v10 = v7 + v6;
Ritor1
parents:
diff changeset
1830 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1831 a2a = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1832 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a )
Ritor1
parents:
diff changeset
1833 a2a = pActor->pActorBuffs[17].uPower;
Ritor1
parents:
diff changeset
1834 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1835 {
Ritor1
parents:
diff changeset
1836 a2a += pActor->pActorBuffs[11].uPower;
Ritor1
parents:
diff changeset
1837 pActor->pActorBuffs[11].Reset();
Ritor1
parents:
diff changeset
1838 }
Ritor1
parents:
diff changeset
1839 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5;
Ritor1
parents:
diff changeset
1840 }
Ritor1
parents:
diff changeset
1841
Ritor1
parents:
diff changeset
1842 //----- (004274AD) --------------------------------------------------------
Ritor1
parents:
diff changeset
1843 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer)
Ritor1
parents:
diff changeset
1844 {
Ritor1
parents:
diff changeset
1845 signed int v3; // edi@1
Ritor1
parents:
diff changeset
1846 signed int v4; // esi@8
Ritor1
parents:
diff changeset
1847 int v5; // esi@8
Ritor1
parents:
diff changeset
1848
Ritor1
parents:
diff changeset
1849 v3 = 0;
Ritor1
parents:
diff changeset
1850 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1851 v3 = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1852 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 )
Ritor1
parents:
diff changeset
1853 v3 = pActor->pActorBuffs[17].uPower;
Ritor1
parents:
diff changeset
1854 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1855 {
Ritor1
parents:
diff changeset
1856 v3 += pActor->pActorBuffs[11].uPower;
Ritor1
parents:
diff changeset
1857 pActor->pActorBuffs[11].Reset();
Ritor1
parents:
diff changeset
1858 }
Ritor1
parents:
diff changeset
1859 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10;
Ritor1
parents:
diff changeset
1860 v5 = rand() % v4 + 1;
Ritor1
parents:
diff changeset
1861 return v3 + v5 > pPlayer->GetActualAC() + 5;
Ritor1
parents:
diff changeset
1862 }
Ritor1
parents:
diff changeset
1863
Ritor1
parents:
diff changeset
1864 //----- (00427546) --------------------------------------------------------
Ritor1
parents:
diff changeset
1865 int stru319::_427546(int a2)
Ritor1
parents:
diff changeset
1866 {
Ritor1
parents:
diff changeset
1867 int result; // eax@2
Ritor1
parents:
diff changeset
1868
Ritor1
parents:
diff changeset
1869 if ( a2 >= 0 )
Ritor1
parents:
diff changeset
1870 {
Ritor1
parents:
diff changeset
1871 if ( a2 >= 1 )
Ritor1
parents:
diff changeset
1872 result = (a2 >= 2) + 2;
Ritor1
parents:
diff changeset
1873 else
Ritor1
parents:
diff changeset
1874 result = 1;
Ritor1
parents:
diff changeset
1875 }
Ritor1
parents:
diff changeset
1876 else
Ritor1
parents:
diff changeset
1877 {
Ritor1
parents:
diff changeset
1878 result = 0;
Ritor1
parents:
diff changeset
1879 }
Ritor1
parents:
diff changeset
1880 return result;
Ritor1
parents:
diff changeset
1881 }
Ritor1
parents:
diff changeset
1882
Ritor1
parents:
diff changeset
1883 //----- (0042756B) --------------------------------------------------------
Ritor1
parents:
diff changeset
1884 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3)
Ritor1
parents:
diff changeset
1885 {
Ritor1
parents:
diff changeset
1886 int v4; // edx@1
Ritor1
parents:
diff changeset
1887 int v5; // ecx@1
Ritor1
parents:
diff changeset
1888 signed int v6; // eax@4
Ritor1
parents:
diff changeset
1889 signed int result; // eax@17
Ritor1
parents:
diff changeset
1890 signed int v8; // esi@18
Ritor1
parents:
diff changeset
1891
Ritor1
parents:
diff changeset
1892 v4 = 0;
Ritor1
parents:
diff changeset
1893 v5 = 0;
Ritor1
parents:
diff changeset
1894 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1895 v5 = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1896 switch ( a2 )
Ritor1
parents:
diff changeset
1897 {
Ritor1
parents:
diff changeset
1898 case 4:
Ritor1
parents:
diff changeset
1899 v6 = pActor->pMonsterInfo.uResPhysical;
Ritor1
parents:
diff changeset
1900 break;
Ritor1
parents:
diff changeset
1901 case 0:
Ritor1
parents:
diff changeset
1902 v6 = pActor->pMonsterInfo.uResFire;
Ritor1
parents:
diff changeset
1903 goto LABEL_12;
Ritor1
parents:
diff changeset
1904 case 1:
Ritor1
parents:
diff changeset
1905 v6 = pActor->pMonsterInfo.uResAir;
Ritor1
parents:
diff changeset
1906 goto LABEL_12;
Ritor1
parents:
diff changeset
1907 case 2:
Ritor1
parents:
diff changeset
1908 v6 = pActor->pMonsterInfo.uResWater;
Ritor1
parents:
diff changeset
1909 goto LABEL_12;
Ritor1
parents:
diff changeset
1910 case 3:
Ritor1
parents:
diff changeset
1911 v6 = pActor->pMonsterInfo.uResEarth;
Ritor1
parents:
diff changeset
1912 goto LABEL_12;
Ritor1
parents:
diff changeset
1913 case 6:
Ritor1
parents:
diff changeset
1914 v6 = pActor->pMonsterInfo.uResSpirit;
Ritor1
parents:
diff changeset
1915 break;
Ritor1
parents:
diff changeset
1916 case 7:
Ritor1
parents:
diff changeset
1917 v6 = pActor->pMonsterInfo.uResMind;
Ritor1
parents:
diff changeset
1918 goto LABEL_12;
Ritor1
parents:
diff changeset
1919 case 8:
Ritor1
parents:
diff changeset
1920 v6 = pActor->pMonsterInfo.uResBody;
Ritor1
parents:
diff changeset
1921 LABEL_12:
Ritor1
parents:
diff changeset
1922 v4 = v5;
Ritor1
parents:
diff changeset
1923 break;
Ritor1
parents:
diff changeset
1924 case 9:
Ritor1
parents:
diff changeset
1925 v6 = pActor->pMonsterInfo.uResLight;
Ritor1
parents:
diff changeset
1926 break;
Ritor1
parents:
diff changeset
1927 case 10:
Ritor1
parents:
diff changeset
1928 v6 = pActor->pMonsterInfo.uResDark;
Ritor1
parents:
diff changeset
1929 break;
Ritor1
parents:
diff changeset
1930 default:
Ritor1
parents:
diff changeset
1931 v6 = 0;
Ritor1
parents:
diff changeset
1932 break;
Ritor1
parents:
diff changeset
1933 }
Ritor1
parents:
diff changeset
1934 if ( v6 < 200 )
Ritor1
parents:
diff changeset
1935 {
Ritor1
parents:
diff changeset
1936 v8 = v4 + v6 + 30;
Ritor1
parents:
diff changeset
1937 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
1938 {
Ritor1
parents:
diff changeset
1939 a3 >>= 1;
Ritor1
parents:
diff changeset
1940 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
1941 {
Ritor1
parents:
diff changeset
1942 a3 >>= 1;
Ritor1
parents:
diff changeset
1943 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
1944 {
Ritor1
parents:
diff changeset
1945 a3 >>= 1;
Ritor1
parents:
diff changeset
1946 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
1947 a3 >>= 1;
Ritor1
parents:
diff changeset
1948 }
Ritor1
parents:
diff changeset
1949 }
Ritor1
parents:
diff changeset
1950 }
Ritor1
parents:
diff changeset
1951 result = a3;
Ritor1
parents:
diff changeset
1952 }
Ritor1
parents:
diff changeset
1953 else
Ritor1
parents:
diff changeset
1954 {
Ritor1
parents:
diff changeset
1955 result = 0;
Ritor1
parents:
diff changeset
1956 }
Ritor1
parents:
diff changeset
1957 return result;
Ritor1
parents:
diff changeset
1958 }
Ritor1
parents:
diff changeset
1959
Ritor1
parents:
diff changeset
1960 //----- (00427662) --------------------------------------------------------
Ritor1
parents:
diff changeset
1961 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType)
Ritor1
parents:
diff changeset
1962 {
Ritor1
parents:
diff changeset
1963 Actor *v3; // edi@2
Ritor1
parents:
diff changeset
1964 signed int v4; // esi@2
Ritor1
parents:
diff changeset
1965 bool result; // eax@13
Ritor1
parents:
diff changeset
1966
Ritor1
parents:
diff changeset
1967 switch ( uType )
Ritor1
parents:
diff changeset
1968 {
Ritor1
parents:
diff changeset
1969 case 0u:
Ritor1
parents:
diff changeset
1970 v3 = pActor;
Ritor1
parents:
diff changeset
1971 v4 = pActor->pMonsterInfo.uResFire;
Ritor1
parents:
diff changeset
1972 goto LABEL_12;
Ritor1
parents:
diff changeset
1973 case 1u:
Ritor1
parents:
diff changeset
1974 v3 = pActor;
Ritor1
parents:
diff changeset
1975 v4 = pActor->pMonsterInfo.uResAir;
Ritor1
parents:
diff changeset
1976 goto LABEL_12;
Ritor1
parents:
diff changeset
1977 case 2u:
Ritor1
parents:
diff changeset
1978 v3 = pActor;
Ritor1
parents:
diff changeset
1979 v4 = pActor->pMonsterInfo.uResWater;
Ritor1
parents:
diff changeset
1980 goto LABEL_12;
Ritor1
parents:
diff changeset
1981 case 3u:
Ritor1
parents:
diff changeset
1982 v3 = pActor;
Ritor1
parents:
diff changeset
1983 v4 = pActor->pMonsterInfo.uResEarth;
Ritor1
parents:
diff changeset
1984 goto LABEL_12;
Ritor1
parents:
diff changeset
1985 case 7u:
Ritor1
parents:
diff changeset
1986 v3 = pActor;
Ritor1
parents:
diff changeset
1987 v4 = pActor->pMonsterInfo.uResMind;
Ritor1
parents:
diff changeset
1988 goto LABEL_12;
Ritor1
parents:
diff changeset
1989 case 6u:
Ritor1
parents:
diff changeset
1990 v3 = pActor;
Ritor1
parents:
diff changeset
1991 v4 = pActor->pMonsterInfo.uResSpirit;
Ritor1
parents:
diff changeset
1992 goto LABEL_12;
Ritor1
parents:
diff changeset
1993 case 8u:
Ritor1
parents:
diff changeset
1994 v3 = pActor;
Ritor1
parents:
diff changeset
1995 v4 = pActor->pMonsterInfo.uResBody;
Ritor1
parents:
diff changeset
1996 goto LABEL_12;
Ritor1
parents:
diff changeset
1997 case 9u:
Ritor1
parents:
diff changeset
1998 v3 = pActor;
Ritor1
parents:
diff changeset
1999 v4 = pActor->pMonsterInfo.uResLight;
Ritor1
parents:
diff changeset
2000 goto LABEL_12;
Ritor1
parents:
diff changeset
2001 case 0xAu:
Ritor1
parents:
diff changeset
2002 v3 = pActor;
Ritor1
parents:
diff changeset
2003 v4 = pActor->pMonsterInfo.uResDark;
Ritor1
parents:
diff changeset
2004 goto LABEL_12;
Ritor1
parents:
diff changeset
2005 case 4u:
Ritor1
parents:
diff changeset
2006 v3 = pActor;
Ritor1
parents:
diff changeset
2007 v4 = pActor->pMonsterInfo.uResPhysical;
Ritor1
parents:
diff changeset
2008 LABEL_12:
Ritor1
parents:
diff changeset
2009 if ( v4 < 200 )
Ritor1
parents:
diff changeset
2010 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30;
Ritor1
parents:
diff changeset
2011 else
Ritor1
parents:
diff changeset
2012 result = 0;
Ritor1
parents:
diff changeset
2013 break;
Ritor1
parents:
diff changeset
2014 default:
Ritor1
parents:
diff changeset
2015 result = 1;
Ritor1
parents:
diff changeset
2016 break;
Ritor1
parents:
diff changeset
2017 }
Ritor1
parents:
diff changeset
2018 return result;
Ritor1
parents:
diff changeset
2019 }
Ritor1
parents:
diff changeset
2020
Ritor1
parents:
diff changeset
2021 //----- (00427769) --------------------------------------------------------
Ritor1
parents:
diff changeset
2022 bool __fastcall sub_427769_spell(unsigned int uSpellID)
Ritor1
parents:
diff changeset
2023 {
Ritor1
parents:
diff changeset
2024 bool result; // eax@2
Ritor1
parents:
diff changeset
2025
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 693
diff changeset
2026 __debugbreak(); // refactor
0
Ritor1
parents:
diff changeset
2027 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC )
Ritor1
parents:
diff changeset
2028 result = 1;
Ritor1
parents:
diff changeset
2029 else
Ritor1
parents:
diff changeset
2030 result = 0;
Ritor1
parents:
diff changeset
2031 return result;
Ritor1
parents:
diff changeset
2032 }
Ritor1
parents:
diff changeset
2033
Ritor1
parents:
diff changeset
2034 //----- (0042777D) --------------------------------------------------------
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2035 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6)
0
Ritor1
parents:
diff changeset
2036 {
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2037 //bool result; // eax@2
486
Nomad
parents: 482
diff changeset
2038 //__int16 v6; // bx@4
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2039 //Player *v7; // eax@4
486
Nomad
parents: 482
diff changeset
2040 //char v8; // zf@12
0
Ritor1
parents:
diff changeset
2041 unsigned __int16 v9; // cx@16
Ritor1
parents:
diff changeset
2042 unsigned int v10; // eax@18
Ritor1
parents:
diff changeset
2043 unsigned __int8 v11; // sf@18
Ritor1
parents:
diff changeset
2044 unsigned __int8 v12; // of@18
Ritor1
parents:
diff changeset
2045 unsigned __int16 v13; // cx@21
Ritor1
parents:
diff changeset
2046 unsigned int v14; // eax@23
486
Nomad
parents: 482
diff changeset
2047 //stru277 *v15; // esi@27
Nomad
parents: 482
diff changeset
2048 //stru277 *v16; // eax@28
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2049 //GUIWindow *v17; // eax@43
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2050 //GUIWindow *v18; // [sp-30h] [bp-48h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2051 //unsigned int v19; // [sp-2Ch] [bp-44h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2052 //unsigned int v20; // [sp-28h] [bp-40h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2053 //unsigned int v21; // [sp-24h] [bp-3Ch]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2054 //unsigned int v22; // [sp-20h] [bp-38h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2055 //int v23; // [sp-1Ch] [bp-34h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2056 //int v24; // [sp-18h] [bp-30h]@44
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2057 //unsigned int v25; // [sp-14h] [bp-2Ch]@43
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2058 //unsigned int v26; // [sp-10h] [bp-28h]@43
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2059 //unsigned __int8 v27; // [sp-Ch] [bp-24h]@43
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2060 //char *v28; // [sp-8h] [bp-20h]@43
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2061 //Texture *v29; // [sp-4h] [bp-1Ch]@43
486
Nomad
parents: 482
diff changeset
2062 //__int16 a3a; // [sp+10h] [bp-8h]@1
Nomad
parents: 482
diff changeset
2063 //__int16 a2a; // [sp+14h] [bp-4h]@1
Nomad
parents: 482
diff changeset
2064
Nomad
parents: 482
diff changeset
2065 //a3a = uPlayerID;
Nomad
parents: 482
diff changeset
2066 //a2a = a1;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2067
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2068 //if ( pParty->bTurnBasedModeOn != 1
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2069 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2070 if (pParty->bTurnBasedModeOn)
0
Ritor1
parents:
diff changeset
2071 {
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2072 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3)
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2073 return;
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2074 }
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2075
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2076
486
Nomad
parents: 482
diff changeset
2077 //v6 = a5;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2078 //v7 = &pParty->pPlayers[uPlayerID];
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2079 assert(uPlayerID < 4);
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2080 auto player = &pParty->pPlayers[uPlayerID];
0
Ritor1
parents:
diff changeset
2081 if ( !(a5 & 0x10) )
Ritor1
parents:
diff changeset
2082 {
Ritor1
parents:
diff changeset
2083 switch ( a1 )
Ritor1
parents:
diff changeset
2084 {
486
Nomad
parents: 482
diff changeset
2085 case SPELL_SPIRIT_FATE:
Nomad
parents: 482
diff changeset
2086 case SPELL_BODY_FIRST_AID:
Nomad
parents: 482
diff changeset
2087 case SPELL_DARK_REANIMATE:
Nomad
parents: 482
diff changeset
2088 //HIBYTE(v6) = HIBYTE(a5) | 1;
Nomad
parents: 482
diff changeset
2089 a5 |= 0x0100;
0
Ritor1
parents:
diff changeset
2090 break;
486
Nomad
parents: 482
diff changeset
2091
Nomad
parents: 482
diff changeset
2092 case SPELL_FIRE_FIRE_AURA:
Nomad
parents: 482
diff changeset
2093 case SPELL_WATER_RECHARGE_ITEM:
Nomad
parents: 482
diff changeset
2094 case SPELL_WATER_ENCHANT_ITEM:
Nomad
parents: 482
diff changeset
2095 case SPELL_DARK_VAMPIRIC_WEAPON:
Nomad
parents: 482
diff changeset
2096 //LOBYTE(v6) = a5 | 0x80;
Nomad
parents: 482
diff changeset
2097 a5 |= 0x0080;
0
Ritor1
parents:
diff changeset
2098 break;
486
Nomad
parents: 482
diff changeset
2099
Nomad
parents: 482
diff changeset
2100 case SPELL_FIRE_FIRE_BOLT:
Nomad
parents: 482
diff changeset
2101 case SPELL_FIRE_FIREBALL:
Nomad
parents: 482
diff changeset
2102 case SPELL_FIRE_INCINERATE:
Nomad
parents: 482
diff changeset
2103 case SPELL_AIR_LIGHNING_BOLT:
Nomad
parents: 482
diff changeset
2104 case SPELL_AIR_IMPLOSION:
Nomad
parents: 482
diff changeset
2105 case SPELL_WATER_POISON_SPRAY:
Nomad
parents: 482
diff changeset
2106 case SPELL_WATER_ICE_BOLT:
Nomad
parents: 482
diff changeset
2107 case SPELL_WATER_ACID_BURST:
Nomad
parents: 482
diff changeset
2108 case SPELL_WATER_ICE_BLAST:
Nomad
parents: 482
diff changeset
2109 case SPELL_EARTH_STUN:
Nomad
parents: 482
diff changeset
2110 case SPELL_EARTH_SLOW:
Nomad
parents: 482
diff changeset
2111 case SPELL_EARTH_DEADLY_SWARM:
Nomad
parents: 482
diff changeset
2112 case SPELL_EARTH_BLADES:
Nomad
parents: 482
diff changeset
2113 case SPELL_EARTH_MASS_DISTORTION:
Nomad
parents: 482
diff changeset
2114 case SPELL_SPIRIT_SPIRIT_LASH:
Nomad
parents: 482
diff changeset
2115 case SPELL_MIND_MIND_BLAST:
Nomad
parents: 482
diff changeset
2116 case SPELL_MIND_CHARM:
Nomad
parents: 482
diff changeset
2117 case SPELL_MIND_PSYCHIC_SHOCK:
Nomad
parents: 482
diff changeset
2118 case SPELL_BODY_HARM:
Nomad
parents: 482
diff changeset
2119 case SPELL_BODY_FLYING_FIST:
Nomad
parents: 482
diff changeset
2120 case SPELL_LIGHT_LIGHT_BOLT:
Nomad
parents: 482
diff changeset
2121 case SPELL_LIGHT_DESTROY_UNDEAD:
Nomad
parents: 482
diff changeset
2122 case SPELL_LIGHT_SUNRAY:
Nomad
parents: 482
diff changeset
2123 case SPELL_DARK_TOXIC_CLOUD:
Nomad
parents: 482
diff changeset
2124 case SPELL_DARK_SHRINKING_RAY:
Nomad
parents: 482
diff changeset
2125 case SPELL_DARK_SHARPMETAL:
Nomad
parents: 482
diff changeset
2126 case SPELL_DARK_DRAGON_BREATH:
0
Ritor1
parents:
diff changeset
2127 if ( !a6 )
486
Nomad
parents: 482
diff changeset
2128 a5 |= 0x0008;
0
Ritor1
parents:
diff changeset
2129 break;
486
Nomad
parents: 482
diff changeset
2130 case SPELL_MIND_TELEPATHY:
Nomad
parents: 482
diff changeset
2131 case SPELL_MIND_BERSERK:
Nomad
parents: 482
diff changeset
2132 case SPELL_MIND_ENSLAVE:
Nomad
parents: 482
diff changeset
2133 case SPELL_LIGHT_PARALYZE:
Nomad
parents: 482
diff changeset
2134 case SPELL_DARK_CONTROL_UNDEAD:
Nomad
parents: 482
diff changeset
2135 //LABEL_9:
Nomad
parents: 482
diff changeset
2136 //v6 = a5 | 8;
Nomad
parents: 482
diff changeset
2137 a5 |= 0x0008;
0
Ritor1
parents:
diff changeset
2138 break;
486
Nomad
parents: 482
diff changeset
2139
Nomad
parents: 482
diff changeset
2140 case SPELL_EARTH_TELEKINESIS:
Nomad
parents: 482
diff changeset
2141 a5 |= 0x0040;
Nomad
parents: 482
diff changeset
2142 break;
Nomad
parents: 482
diff changeset
2143
Nomad
parents: 482
diff changeset
2144 case SPELL_SPIRIT_BLESS:
Nomad
parents: 482
diff changeset
2145 if (a4 && ~a4 & 0x01C0)
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2146 //goto LABEL_25;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2147 {
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2148 a5 |= 0x0002;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2149 break;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2150 }
486
Nomad
parents: 482
diff changeset
2151 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0);
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2152 //goto LABEL_25;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2153 {
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2154 a5 |= 0x0002;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2155 break;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2156 }
0
Ritor1
parents:
diff changeset
2157 break;
486
Nomad
parents: 482
diff changeset
2158
Nomad
parents: 482
diff changeset
2159 case SPELL_SPIRIT_PRESERVATION:
0
Ritor1
parents:
diff changeset
2160 v9 = a4;
Ritor1
parents:
diff changeset
2161 if ( !a4 )
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2162 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT];
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2163 //goto LABEL_18;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2164 v10 = SkillToMastery(v9);
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2165 v12 = __OFSUB__(v10, 3);
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2166 v11 = ((v10 - 3) & 0x80000000u) != 0;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2167 //goto LABEL_24;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2168 if ( v11 ^ v12 )
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2169 {
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2170 a5 |= 0x0002;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2171 break;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2172 }
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2173 break;
486
Nomad
parents: 482
diff changeset
2174
Nomad
parents: 482
diff changeset
2175 case SPELL_DARK_PAIN_REFLECTION:
0
Ritor1
parents:
diff changeset
2176 v9 = a4;
Ritor1
parents:
diff changeset
2177 if ( !a4 )
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2178 v9 = player->pActiveSkills[PLAYER_SKILL_DARK];
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2179 //LABEL_18:
0
Ritor1
parents:
diff changeset
2180 v10 = SkillToMastery(v9);
Ritor1
parents:
diff changeset
2181 v12 = __OFSUB__(v10, 3);
Ritor1
parents:
diff changeset
2182 v11 = ((v10 - 3) & 0x80000000u) != 0;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2183 //goto LABEL_24;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2184 if ( v11 ^ v12 )
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2185 {
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2186 a5 |= 0x0002;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2187 break;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2188 }
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2189 break;
486
Nomad
parents: 482
diff changeset
2190
Nomad
parents: 482
diff changeset
2191 case SPELL_BODY_HAMMERHANDS:
0
Ritor1
parents:
diff changeset
2192 v13 = a4;
Ritor1
parents:
diff changeset
2193 if ( !a4 )
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
2194 v13 = player->pActiveSkills[PLAYER_SKILL_BODY];
0
Ritor1
parents:
diff changeset
2195 v14 = SkillToMastery(v13);
Ritor1
parents:
diff changeset
2196 v12 = __OFSUB__(v14, 4);
Ritor1
parents:
diff changeset
2197 v11 = ((v14 - 4) & 0x80000000u) != 0;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2198 //LABEL_24:
0
Ritor1
parents:
diff changeset
2199 if ( v11 ^ v12 )
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2200 //goto LABEL_25;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2201 {
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2202 a5 |= 0x0002;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2203 break;
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2204 }
0
Ritor1
parents:
diff changeset
2205 break;
486
Nomad
parents: 482
diff changeset
2206
Nomad
parents: 482
diff changeset
2207 case SPELL_EARTH_STONE_TO_FLESH:
Nomad
parents: 482
diff changeset
2208 case SPELL_SPIRIT_REMOVE_CURSE:
Nomad
parents: 482
diff changeset
2209 case SPELL_SPIRIT_RAISE_DEAD:
Nomad
parents: 482
diff changeset
2210 case SPELL_SPIRIT_RESSURECTION:
Nomad
parents: 482
diff changeset
2211 case SPELL_MIND_REMOVE_FEAR:
Nomad
parents: 482
diff changeset
2212 case SPELL_MIND_CURE_PARALYSIS:
Nomad
parents: 482
diff changeset
2213 case SPELL_MIND_CURE_INSANITY:
Nomad
parents: 482
diff changeset
2214 case SPELL_BODY_CURE_WEAKNESS:
Nomad
parents: 482
diff changeset
2215 case SPELL_BODY_REGENERATION:
Nomad
parents: 482
diff changeset
2216 case SPELL_BODY_CURE_POISON:
Nomad
parents: 482
diff changeset
2217 case SPELL_BODY_CURE_DISEASE:
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2218 //LABEL_25:
486
Nomad
parents: 482
diff changeset
2219 //v6 = a5 | 2;
Nomad
parents: 482
diff changeset
2220 a5 |= 0x0002;
0
Ritor1
parents:
diff changeset
2221 break;
486
Nomad
parents: 482
diff changeset
2222
Nomad
parents: 482
diff changeset
2223 case SPELL_DARK_SACRIFICE:
Nomad
parents: 482
diff changeset
2224 //HIBYTE(v6) = HIBYTE(a5) | 2;
Nomad
parents: 482
diff changeset
2225 a5 |= 0x0200;
0
Ritor1
parents:
diff changeset
2226 break;
Ritor1
parents:
diff changeset
2227 default:
Ritor1
parents:
diff changeset
2228 break;
Ritor1
parents:
diff changeset
2229 }
Ritor1
parents:
diff changeset
2230 }
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2231
486
Nomad
parents: 482
diff changeset
2232
Nomad
parents: 482
diff changeset
2233 if (a5 & 0x3CA)
0
Ritor1
parents:
diff changeset
2234 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2235 assert(sizeof(pCastSpellInfo) / sizeof(*pCastSpellInfo) == 10);
486
Nomad
parents: 482
diff changeset
2236 for (uint i = 0; i < 10; ++i)
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2237 if (pCastSpellInfo[i].field_8 & 0x3CA)
486
Nomad
parents: 482
diff changeset
2238 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2239 pCastSpellInfo[i].spellnum = 0;
486
Nomad
parents: 482
diff changeset
2240 break;
Nomad
parents: 482
diff changeset
2241 }
0
Ritor1
parents:
diff changeset
2242 }
486
Nomad
parents: 482
diff changeset
2243
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2244 assert(sizeof(pCastSpellInfo) / sizeof(*pCastSpellInfo) == 10);
486
Nomad
parents: 482
diff changeset
2245 for (uint i = 0; i < 10; ++i)
0
Ritor1
parents:
diff changeset
2246 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2247 auto spell = pCastSpellInfo + i;
486
Nomad
parents: 482
diff changeset
2248 if (!spell->spellnum)
Nomad
parents: 482
diff changeset
2249 continue;
Nomad
parents: 482
diff changeset
2250
Nomad
parents: 482
diff changeset
2251 spell->spellnum = 0;
Nomad
parents: 482
diff changeset
2252 if (spell->field_8 & 0x3CA)
0
Ritor1
parents:
diff changeset
2253 {
486
Nomad
parents: 482
diff changeset
2254 pGUIWindow_Settings->Release();
Nomad
parents: 482
diff changeset
2255 pGUIWindow_Settings = nullptr;
Nomad
parents: 482
diff changeset
2256 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 735
diff changeset
2257 GameUI_Footer_TimeLeft = 0;
486
Nomad
parents: 482
diff changeset
2258 unk_50C9A0 = 0;
Nomad
parents: 482
diff changeset
2259 back_to_game();
0
Ritor1
parents:
diff changeset
2260 }
Ritor1
parents:
diff changeset
2261 }
486
Nomad
parents: 482
diff changeset
2262
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2263 int result = pCastSpellInfo->PushCastSpellInfo(a1, uPlayerID, a4, a5, a6);
0
Ritor1
parents:
diff changeset
2264 if ( result != -1 )
Ritor1
parents:
diff changeset
2265 {
486
Nomad
parents: 482
diff changeset
2266 if ( a5 & 2 )
0
Ritor1
parents:
diff changeset
2267 {
Ritor1
parents:
diff changeset
2268 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2269 return;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2270 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2271 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2272 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2273 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2274 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0);
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2275 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2276 return;
0
Ritor1
parents:
diff changeset
2277 }
486
Nomad
parents: 482
diff changeset
2278 if ( a5 & 8 )
0
Ritor1
parents:
diff changeset
2279 {
Ritor1
parents:
diff changeset
2280 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2281 return;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2282
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2283 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2284 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0);
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2285 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2286 return;
0
Ritor1
parents:
diff changeset
2287 }
486
Nomad
parents: 482
diff changeset
2288 if ( a5 & 0x40 )
0
Ritor1
parents:
diff changeset
2289 {
Ritor1
parents:
diff changeset
2290 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2291 return;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2292
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2293 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2294 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_BE, 0, 0, "", 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2295 sub_421B2C_PlaceInInventory_or_DropPickedItem();
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2296 return;
0
Ritor1
parents:
diff changeset
2297 }
486
Nomad
parents: 482
diff changeset
2298 if ( (char)a5 < 0 )
0
Ritor1
parents:
diff changeset
2299 {
Ritor1
parents:
diff changeset
2300 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2301 return;
0
Ritor1
parents:
diff changeset
2302 ++pIcons_LOD->uTexturePacksCount;
Ritor1
parents:
diff changeset
2303 if ( !pIcons_LOD->uNumPrevLoadedFiles )
Ritor1
parents:
diff changeset
2304 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2305 pGUIWindow_Settings = pCastSpellInfo[result].sub_4219BE();
0
Ritor1
parents:
diff changeset
2306 unk_50C9A0 = 1;
Ritor1
parents:
diff changeset
2307 some_active_character = uActiveCharacter;
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2308 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2309 return;
0
Ritor1
parents:
diff changeset
2310 }
486
Nomad
parents: 482
diff changeset
2311 if ( HIBYTE(a5) & 1 )
0
Ritor1
parents:
diff changeset
2312 {
Ritor1
parents:
diff changeset
2313 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2314 return;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2315 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2316 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2317 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2318 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2319 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2320 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL);
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2321 sub_421B2C_PlaceInInventory_or_DropPickedItem();
0
Ritor1
parents:
diff changeset
2322 }
486
Nomad
parents: 482
diff changeset
2323 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings )
0
Ritor1
parents:
diff changeset
2324 {
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2325 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2326 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178,
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2327 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2328 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 958
diff changeset
2329 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "",
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2330 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2331 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178,
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2332 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2333 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 958
diff changeset
2334 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "",
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2335 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2336 pGUIWindow_Settings->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 4, 0x35u, "", 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2337 pGUIWindow_Settings->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 5, 0x36u, "", 0);
0
Ritor1
parents:
diff changeset
2338 }
Ritor1
parents:
diff changeset
2339 }
Ritor1
parents:
diff changeset
2340 }
Ritor1
parents:
diff changeset
2341
Ritor1
parents:
diff changeset
2342 //----- (00427D48) --------------------------------------------------------
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2343 void CastSpellInfo::_427D48(unsigned int uPlayerID)
0
Ritor1
parents:
diff changeset
2344 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2345 CastSpellInfo *v2; // esi@1
0
Ritor1
parents:
diff changeset
2346 signed int v3; // ebx@1
Ritor1
parents:
diff changeset
2347
Ritor1
parents:
diff changeset
2348 v2 = this;
Ritor1
parents:
diff changeset
2349 v3 = 10;
Ritor1
parents:
diff changeset
2350 do
Ritor1
parents:
diff changeset
2351 {
Ritor1
parents:
diff changeset
2352 if ( v2->spellnum )
Ritor1
parents:
diff changeset
2353 {
Ritor1
parents:
diff changeset
2354 if ( v2->field_8 & 0x3CA )
Ritor1
parents:
diff changeset
2355 {
Ritor1
parents:
diff changeset
2356 v2->spellnum = 0;
Ritor1
parents:
diff changeset
2357 pGUIWindow_Settings->Release();
Ritor1
parents:
diff changeset
2358 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
2359 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 735
diff changeset
2360 GameUI_Footer_TimeLeft = 0;
0
Ritor1
parents:
diff changeset
2361 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
2362 back_to_game();
Ritor1
parents:
diff changeset
2363 }
Ritor1
parents:
diff changeset
2364 }
Ritor1
parents:
diff changeset
2365 ++v2;
Ritor1
parents:
diff changeset
2366 --v3;
Ritor1
parents:
diff changeset
2367 }
Ritor1
parents:
diff changeset
2368 while ( v3 );
Ritor1
parents:
diff changeset
2369 }
Ritor1
parents:
diff changeset
2370
Ritor1
parents:
diff changeset
2371 //----- (00427DA0) --------------------------------------------------------
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2372 unsigned int CastSpellInfo::PushCastSpellInfo(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int spell_sound_id)
0
Ritor1
parents:
diff changeset
2373 {
Ritor1
parents:
diff changeset
2374 unsigned int result; // eax@1
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2375 CastSpellInfo *v7; // edx@1
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2376 CastSpellInfo *v8; // ecx@5
0
Ritor1
parents:
diff changeset
2377
Ritor1
parents:
diff changeset
2378 result = 0;
Ritor1
parents:
diff changeset
2379 v7 = this;
Ritor1
parents:
diff changeset
2380 while ( v7->spellnum )
Ritor1
parents:
diff changeset
2381 {
Ritor1
parents:
diff changeset
2382 ++result;
Ritor1
parents:
diff changeset
2383 ++v7;
Ritor1
parents:
diff changeset
2384 if ( (signed int)result >= 10 )
Ritor1
parents:
diff changeset
2385 goto LABEL_8;
Ritor1
parents:
diff changeset
2386 }
Ritor1
parents:
diff changeset
2387 v8 = &this[result];
Ritor1
parents:
diff changeset
2388 v8->spellnum = a2;
Ritor1
parents:
diff changeset
2389 v8->uPlayerID = uPlayerID;
Ritor1
parents:
diff changeset
2390 if ( a5 & 0x10 )
Ritor1
parents:
diff changeset
2391 v8->uPlayerID_2 = uPlayerID;
Ritor1
parents:
diff changeset
2392 v8->field_6 = 0;
488
Nomad
parents: 486
diff changeset
2393 v8->spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
2394 v8->field_8 = a5;
488
Nomad
parents: 486
diff changeset
2395 v8->forced_spell_skill_level = skill_level;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2396 v8->sound_id = spell_sound_id;
0
Ritor1
parents:
diff changeset
2397 LABEL_8:
Ritor1
parents:
diff changeset
2398 if ( result == 10 )
Ritor1
parents:
diff changeset
2399 result = -1;
Ritor1
parents:
diff changeset
2400 return result;
Ritor1
parents:
diff changeset
2401 }
Ritor1
parents:
diff changeset
2402
Ritor1
parents:
diff changeset
2403 //----- (00427E01) --------------------------------------------------------
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2404 void CastSpellInfo::_427E01_cast_spell()
0
Ritor1
parents:
diff changeset
2405 {
486
Nomad
parents: 482
diff changeset
2406 //int v1; // esi@1
0
Ritor1
parents:
diff changeset
2407 int v2; // edi@1
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
2408 CastSpellInfo *pCastSpell; // ebx@2
488
Nomad
parents: 486
diff changeset
2409 //signed int v4; // eax@8
Nomad
parents: 486
diff changeset
2410 //__int16 v5; // ax@9
0
Ritor1
parents:
diff changeset
2411 signed int v6; // eax@14
488
Nomad
parents: 486
diff changeset
2412 //__int16 v7; // ax@23
Nomad
parents: 486
diff changeset
2413 //__int16 v8; // ax@24
Nomad
parents: 486
diff changeset
2414 //char v9; // al@44
Nomad
parents: 486
diff changeset
2415 //int v10; // eax@45
0
Ritor1
parents:
diff changeset
2416 unsigned __int16 v11; // cx@45
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
2417 //signed int v12; // ecx@48
490
Nomad
parents: 488
diff changeset
2418 //int v13; // eax@53
0
Ritor1
parents:
diff changeset
2419 unsigned __int8 v14; // zf@53
488
Nomad
parents: 486
diff changeset
2420 //unsigned int v15; // edx@53
Nomad
parents: 486
diff changeset
2421 //signed int v16; // eax@53
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
2422 //Player *v17; // esi@70
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
2423 //int v18; // eax@72
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2424 //int v19; // eax@74
888
abf7b7d2c8f7 small fixes
zipi
parents: 887
diff changeset
2425 Player *v20; // eax@74
0
Ritor1
parents:
diff changeset
2426 signed int i; // esi@76
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2427 //int v22; // eax@88
0
Ritor1
parents:
diff changeset
2428 __int16 v23; // ax@88
488
Nomad
parents: 486
diff changeset
2429 //int v24; // ecx@93
Nomad
parents: 486
diff changeset
2430 //int v25; // ecx@94
Nomad
parents: 486
diff changeset
2431 //signed __int64 v26; // qax@100
Nomad
parents: 486
diff changeset
2432 //char *v27; // ecx@100
Nomad
parents: 486
diff changeset
2433 //unsigned __int64 v28; // qax@102
0
Ritor1
parents:
diff changeset
2434 int v29; // ecx@105
Ritor1
parents:
diff changeset
2435 int v30; // ecx@106
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
2436 //int v31; // eax@112
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
2437 //int v32; // eax@112
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
2438 //char *v33; // edx@113
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2439 //int v34; // eax@121
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2440 //int v35; // eax@123
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2441 //int v36; // edx@125
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2442 //int v37; // eax@129
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2443 //signed int v38; // edi@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2444 //signed int v39; // eax@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2445 //int v40; // ecx@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2446 //int v41; // eax@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2447 //signed int v42; // eax@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2448 //int *v43; // ecx@129
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2449 //int v44; // eax@132
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2450 //int v45; // ecx@132
0
Ritor1
parents:
diff changeset
2451 int v46; // eax@132
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2452 //unsigned int v47; // edx@133
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2453 //int v48; // eax@137
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2454 //int v49; // eax@137
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
2455 //int v50; // eax@141
0
Ritor1
parents:
diff changeset
2456 int v51; // eax@146
Ritor1
parents:
diff changeset
2457 __int16 v52; // ax@153
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2458 //int v53; // eax@153
0
Ritor1
parents:
diff changeset
2459 signed __int64 v54; // qax@164
Ritor1
parents:
diff changeset
2460 int v55; // edi@164
488
Nomad
parents: 486
diff changeset
2461 //stru6 *v56; // eax@165
0
Ritor1
parents:
diff changeset
2462 int v57; // eax@169
Ritor1
parents:
diff changeset
2463 signed __int64 v58; // qax@177
Ritor1
parents:
diff changeset
2464 int v59; // edi@177
Ritor1
parents:
diff changeset
2465 unsigned __int16 v60; // ax@184
Ritor1
parents:
diff changeset
2466 int v61; // ecx@184
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2467 //int v62; // eax@186
0
Ritor1
parents:
diff changeset
2468 int v63; // ecx@187
Ritor1
parents:
diff changeset
2469 int v64; // ecx@188
Ritor1
parents:
diff changeset
2470 int v65; // ecx@189
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 693
diff changeset
2471 //const char *v66; // ecx@200
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 693
diff changeset
2472 //unsigned int v67; // edx@201
0
Ritor1
parents:
diff changeset
2473 char v68; // al@207
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
2474 ItemGen *v69; // esi@211
0
Ritor1
parents:
diff changeset
2475 int v70; // ecx@214
Ritor1
parents:
diff changeset
2476 int v71; // ecx@215
Ritor1
parents:
diff changeset
2477 int v72; // ecx@216
488
Nomad
parents: 486
diff changeset
2478 //__int16 v73; // ST1C_2@222
Nomad
parents: 486
diff changeset
2479 //__int16 v74; // ST18_2@222
Nomad
parents: 486
diff changeset
2480 //stru6 *v75; // eax@222
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2481 //int v76; // ecx@223
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2482 //int v77; // ecx@224
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2483 //int v78; // ecx@225
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2484 //int v79; // eax@227
488
Nomad
parents: 486
diff changeset
2485 //int v80; // eax@232
Nomad
parents: 486
diff changeset
2486 //__int16 v81; // ST18_2@245
Nomad
parents: 486
diff changeset
2487 //stru6 *v82; // eax@245
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2488 //signed int v83; // edi@245
488
Nomad
parents: 486
diff changeset
2489 //__int16 v84; // ST18_2@245
Nomad
parents: 486
diff changeset
2490 //stru6 *v85; // eax@245
Nomad
parents: 486
diff changeset
2491 //__int16 v86; // ST18_2@245
Nomad
parents: 486
diff changeset
2492 //stru6 *v87; // eax@245
Nomad
parents: 486
diff changeset
2493 //__int16 v88; // ST18_2@245
Nomad
parents: 486
diff changeset
2494 //stru6 *v89; // eax@245
0
Ritor1
parents:
diff changeset
2495 double v90; // st7@245
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2496 //int v91; // eax@250
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
2497 Player *v92; // eax@255
488
Nomad
parents: 486
diff changeset
2498 //__int16 v93; // ST18_2@260
Nomad
parents: 486
diff changeset
2499 //stru6 *v94; // eax@260
Nomad
parents: 486
diff changeset
2500 //__int16 v95; // ST18_2@260
Nomad
parents: 486
diff changeset
2501 //stru6 *v96; // eax@260
Nomad
parents: 486
diff changeset
2502 //__int16 v97; // ST18_2@260
Nomad
parents: 486
diff changeset
2503 //stru6 *v98; // eax@260
Nomad
parents: 486
diff changeset
2504 //__int16 v99; // ST18_2@260
Nomad
parents: 486
diff changeset
2505 //stru6 *v100; // eax@260
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2506 //int v101; // ecx@261
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2507 //int v102; // ecx@262
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2508 //int v103; // ecx@263
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2509 //int v104; // eax@265
0
Ritor1
parents:
diff changeset
2510 int v105; // edi@271
488
Nomad
parents: 486
diff changeset
2511 //__int16 v106; // ST18_2@272
Nomad
parents: 486
diff changeset
2512 //stru6 *v107; // eax@272
0
Ritor1
parents:
diff changeset
2513 __int16 v108; // ST1C_2@274
Ritor1
parents:
diff changeset
2514 __int16 v109; // ST18_2@274
Ritor1
parents:
diff changeset
2515 stru6 *v110; // eax@274
Ritor1
parents:
diff changeset
2516 int v111; // eax@274
Ritor1
parents:
diff changeset
2517 Actor *v112; // esi@278
Ritor1
parents:
diff changeset
2518 int v113; // eax@278
Ritor1
parents:
diff changeset
2519 int v114; // ebx@278
Ritor1
parents:
diff changeset
2520 unsigned int v115; // ecx@278
Ritor1
parents:
diff changeset
2521 int v116; // edx@279
Ritor1
parents:
diff changeset
2522 int v117; // edx@281
Ritor1
parents:
diff changeset
2523 int v118; // edx@283
Ritor1
parents:
diff changeset
2524 int v119; // edi@286
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2525 //int v120; // eax@286
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2526 //int v121; // eax@286
0
Ritor1
parents:
diff changeset
2527 signed int v122; // eax@286
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2528 //int v123; // ecx@288
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2529 //int v124; // ecx@289
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2530 //int v125; // ecx@290
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2531 //int v126; // eax@292
0
Ritor1
parents:
diff changeset
2532 int v127; // eax@296
488
Nomad
parents: 486
diff changeset
2533 //__int16 v128; // ST18_2@303
Nomad
parents: 486
diff changeset
2534 //stru6 *v129; // eax@303
Nomad
parents: 486
diff changeset
2535 //__int16 v130; // ST18_2@303
Nomad
parents: 486
diff changeset
2536 //stru6 *v131; // eax@303
Nomad
parents: 486
diff changeset
2537 //__int16 v132; // ST18_2@303
Nomad
parents: 486
diff changeset
2538 //stru6 *v133; // eax@303
Nomad
parents: 486
diff changeset
2539 //__int16 v134; // ST18_2@303
Nomad
parents: 486
diff changeset
2540 //stru6 *v135; // eax@303
Nomad
parents: 486
diff changeset
2541 //unsigned __int64 v136; // qax@304
Nomad
parents: 486
diff changeset
2542 //char *v137; // ecx@304
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2543 //int v138; // ecx@305
0
Ritor1
parents:
diff changeset
2544 int v139; // ecx@306
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2545 //int v140; // eax@308
488
Nomad
parents: 486
diff changeset
2546 //__int16 v141; // ST18_2@311
Nomad
parents: 486
diff changeset
2547 //stru6 *v142; // eax@311
Nomad
parents: 486
diff changeset
2548 //__int16 v143; // ST18_2@311
Nomad
parents: 486
diff changeset
2549 //stru6 *v144; // eax@311
Nomad
parents: 486
diff changeset
2550 //__int16 v145; // ST18_2@311
Nomad
parents: 486
diff changeset
2551 //stru6 *v146; // eax@311
Nomad
parents: 486
diff changeset
2552 //__int16 v147; // ST18_2@311
Nomad
parents: 486
diff changeset
2553 //stru6 *v148; // eax@311
0
Ritor1
parents:
diff changeset
2554 int v149; // ecx@312
Ritor1
parents:
diff changeset
2555 int v150; // ecx@313
Ritor1
parents:
diff changeset
2556 int v151; // ecx@314
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2557 //signed int v152; // eax@322
0
Ritor1
parents:
diff changeset
2558 int v153; // ecx@322
Ritor1
parents:
diff changeset
2559 int v154; // eax@322
Ritor1
parents:
diff changeset
2560 int v155; // eax@323
Ritor1
parents:
diff changeset
2561 int v156; // eax@323
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2562 //int v157; // eax@326
0
Ritor1
parents:
diff changeset
2563 double v158; // st7@326
Ritor1
parents:
diff changeset
2564 double v159; // st6@326
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2565 //signed __int64 v160; // qtt@334
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2566 //int v161; // eax@339
0
Ritor1
parents:
diff changeset
2567 int v162; // edi@340
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2568 //int v163; // eax@340
0
Ritor1
parents:
diff changeset
2569 signed int v164; // eax@340
Ritor1
parents:
diff changeset
2570 signed int v165; // edi@340
488
Nomad
parents: 486
diff changeset
2571 //stru6 *v166; // eax@340
Nomad
parents: 486
diff changeset
2572 //stru6 *v167; // eax@340
0
Ritor1
parents:
diff changeset
2573 signed int v168; // edi@343
Ritor1
parents:
diff changeset
2574 int v169; // eax@344
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2575 //int v170; // ecx@346
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2576 //int v171; // ecx@347
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2577 //int v172; // ecx@348
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2578 //int v173; // edi@350
0
Ritor1
parents:
diff changeset
2579 signed int v174; // edi@355
488
Nomad
parents: 486
diff changeset
2580 //__int16 v175; // ST18_2@357
Nomad
parents: 486
diff changeset
2581 //stru6 *v176; // eax@357
Nomad
parents: 486
diff changeset
2582 //__int16 v177; // ST18_2@357
Nomad
parents: 486
diff changeset
2583 //stru6 *v178; // eax@357
Nomad
parents: 486
diff changeset
2584 //__int16 v179; // ST18_2@357
Nomad
parents: 486
diff changeset
2585 //stru6 *v180; // eax@357
Nomad
parents: 486
diff changeset
2586 //__int16 v181; // ST18_2@357
Nomad
parents: 486
diff changeset
2587 //stru6 *v182; // eax@357
Nomad
parents: 486
diff changeset
2588 //signed __int64 v183; // qax@357
0
Ritor1
parents:
diff changeset
2589 int v184; // ecx@358
Ritor1
parents:
diff changeset
2590 int v185; // ecx@359
Ritor1
parents:
diff changeset
2591 int v186; // ecx@360
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2592 //int v187; // eax@367
0
Ritor1
parents:
diff changeset
2593 int v188; // esi@369
Ritor1
parents:
diff changeset
2594 int v189; // edi@369
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 693
diff changeset
2595 //const char *v190; // ecx@377
0
Ritor1
parents:
diff changeset
2596 signed int v191; // edi@379
Ritor1
parents:
diff changeset
2597 int v192; // ecx@382
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2598 //int v193; // ecx@383
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2599 //int v194; // ecx@384
0
Ritor1
parents:
diff changeset
2600 int v195; // eax@386
Ritor1
parents:
diff changeset
2601 int v196; // eax@387
488
Nomad
parents: 486
diff changeset
2602 //__int16 v197; // ST18_2@395
Nomad
parents: 486
diff changeset
2603 //stru6 *v198; // eax@395
Nomad
parents: 486
diff changeset
2604 //__int16 v199; // ST18_2@395
Nomad
parents: 486
diff changeset
2605 //stru6 *v200; // eax@395
Nomad
parents: 486
diff changeset
2606 //__int16 v201; // ST18_2@395
Nomad
parents: 486
diff changeset
2607 //stru6 *v202; // eax@395
Nomad
parents: 486
diff changeset
2608 //__int16 v203; // ST18_2@395
Nomad
parents: 486
diff changeset
2609 //stru6 *v204; // eax@395
0
Ritor1
parents:
diff changeset
2610 signed int v205; // edi@405
Ritor1
parents:
diff changeset
2611 int v206; // eax@407
Ritor1
parents:
diff changeset
2612 __int16 v207; // cx@407
Ritor1
parents:
diff changeset
2613 int v208; // eax@411
Ritor1
parents:
diff changeset
2614 signed int v209; // ecx@412
Ritor1
parents:
diff changeset
2615 int v210; // edx@412
Ritor1
parents:
diff changeset
2616 signed int v211; // ecx@412
Ritor1
parents:
diff changeset
2617 int v212; // eax@413
Ritor1
parents:
diff changeset
2618 int v213; // eax@413
Ritor1
parents:
diff changeset
2619 int v214; // eax@413
Ritor1
parents:
diff changeset
2620 int v215; // eax@415
Ritor1
parents:
diff changeset
2621 double v216; // st7@415
Ritor1
parents:
diff changeset
2622 double v217; // st6@415
Ritor1
parents:
diff changeset
2623 signed __int64 v218; // qtt@423
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2624 //int v219; // ecx@425
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2625 //int v220; // ecx@426
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2626 //int v221; // edi@428
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
2627 Player *v222; // edi@434
0
Ritor1
parents:
diff changeset
2628 char v223; // al@438
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2629 //int v224; // ecx@442
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2630 //int v225; // ecx@443
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2631 //int v226; // eax@451
0
Ritor1
parents:
diff changeset
2632 int v227; // esi@453
Ritor1
parents:
diff changeset
2633 unsigned int v228; // edi@454
Ritor1
parents:
diff changeset
2634 int v229; // edi@466
488
Nomad
parents: 486
diff changeset
2635 //__int16 v230; // ST18_2@469
Nomad
parents: 486
diff changeset
2636 //stru6 *v231; // eax@469
Nomad
parents: 486
diff changeset
2637 //signed int v232; // esi@469
Nomad
parents: 486
diff changeset
2638 //__int16 v233; // ST18_2@469
Nomad
parents: 486
diff changeset
2639 //stru6 *v234; // eax@469
Nomad
parents: 486
diff changeset
2640 //__int16 v235; // ST18_2@469
Nomad
parents: 486
diff changeset
2641 //stru6 *v236; // eax@469
Nomad
parents: 486
diff changeset
2642 //__int16 v237; // ST18_2@469
Nomad
parents: 486
diff changeset
2643 //stru6 *v238; // eax@469
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2644 //__int16 v239; // ST1C_2@469
0
Ritor1
parents:
diff changeset
2645 char *v240; // ecx@472
Ritor1
parents:
diff changeset
2646 double v241; // st7@478
Ritor1
parents:
diff changeset
2647 signed __int64 v242; // qax@484
Ritor1
parents:
diff changeset
2648 char *v243; // ecx@484
Ritor1
parents:
diff changeset
2649 char *v244; // eax@488
Ritor1
parents:
diff changeset
2650 int v245; // edi@492
Ritor1
parents:
diff changeset
2651 int v246; // eax@492
Ritor1
parents:
diff changeset
2652 char *v247; // eax@497
Ritor1
parents:
diff changeset
2653 char v248; // al@497
Ritor1
parents:
diff changeset
2654 char v249; // cf@500
Ritor1
parents:
diff changeset
2655 float v250; // esi@507
Ritor1
parents:
diff changeset
2656 char v251; // al@507
Ritor1
parents:
diff changeset
2657 int v252; // edx@510
Ritor1
parents:
diff changeset
2658 int m; // esi@510
Ritor1
parents:
diff changeset
2659 int v254; // eax@513
Ritor1
parents:
diff changeset
2660 int v255; // esi@513
Ritor1
parents:
diff changeset
2661 int v256; // ecx@513
Ritor1
parents:
diff changeset
2662 int v257; // edx@514
Ritor1
parents:
diff changeset
2663 int v258; // ecx@514
Ritor1
parents:
diff changeset
2664 char v259; // al@516
Ritor1
parents:
diff changeset
2665 int v260; // eax@518
Ritor1
parents:
diff changeset
2666 int v261; // esi@519
Ritor1
parents:
diff changeset
2667 int v262; // edx@521
Ritor1
parents:
diff changeset
2668 int v263; // ecx@521
Ritor1
parents:
diff changeset
2669 int v264; // esi@521
Ritor1
parents:
diff changeset
2670 int v265; // edx@521
Ritor1
parents:
diff changeset
2671 int *ii; // eax@522
Ritor1
parents:
diff changeset
2672 int v267; // eax@524
Ritor1
parents:
diff changeset
2673 int v268; // eax@524
Ritor1
parents:
diff changeset
2674 int v269; // eax@526
Ritor1
parents:
diff changeset
2675 char *v270; // eax@531
Ritor1
parents:
diff changeset
2676 char v271; // al@531
Ritor1
parents:
diff changeset
2677 char v272; // cf@534
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2678 //float v273; // esi@541
0
Ritor1
parents:
diff changeset
2679 char v274; // al@541
Ritor1
parents:
diff changeset
2680 int v275; // edx@544
Ritor1
parents:
diff changeset
2681 int k; // esi@544
Ritor1
parents:
diff changeset
2682 int v277; // edx@548
Ritor1
parents:
diff changeset
2683 int v278; // ecx@548
Ritor1
parents:
diff changeset
2684 char v279; // al@550
Ritor1
parents:
diff changeset
2685 int v280; // eax@552
Ritor1
parents:
diff changeset
2686 int v281; // esi@553
Ritor1
parents:
diff changeset
2687 int v282; // edx@555
Ritor1
parents:
diff changeset
2688 int v283; // ecx@555
Ritor1
parents:
diff changeset
2689 int v284; // esi@555
Ritor1
parents:
diff changeset
2690 int v285; // edx@555
Ritor1
parents:
diff changeset
2691 int *l; // eax@556
Ritor1
parents:
diff changeset
2692 int v287; // eax@558
Ritor1
parents:
diff changeset
2693 int v288; // eax@558
Ritor1
parents:
diff changeset
2694 ItemGen *v289; // eax@560
Ritor1
parents:
diff changeset
2695 signed int v290; // eax@560
Ritor1
parents:
diff changeset
2696 unsigned __int8 v291; // al@564
Ritor1
parents:
diff changeset
2697 char v292; // al@573
Ritor1
parents:
diff changeset
2698 int v293; // eax@575
Ritor1
parents:
diff changeset
2699 ItemGen *v294; // esi@575
Ritor1
parents:
diff changeset
2700 int v295; // edx@575
Ritor1
parents:
diff changeset
2701 int kk; // edi@575
Ritor1
parents:
diff changeset
2702 int v297; // edx@579
Ritor1
parents:
diff changeset
2703 int v298; // ecx@579
Ritor1
parents:
diff changeset
2704 char v299; // al@581
Ritor1
parents:
diff changeset
2705 int v300; // eax@583
Ritor1
parents:
diff changeset
2706 int v301; // edi@584
Ritor1
parents:
diff changeset
2707 int v302; // edx@586
Ritor1
parents:
diff changeset
2708 int v303; // ecx@586
Ritor1
parents:
diff changeset
2709 int v304; // edi@586
Ritor1
parents:
diff changeset
2710 int v305; // edx@586
Ritor1
parents:
diff changeset
2711 int *jj; // eax@587
Ritor1
parents:
diff changeset
2712 int v307; // eax@589
Ritor1
parents:
diff changeset
2713 int v308; // eax@589
Ritor1
parents:
diff changeset
2714 char *v309; // ecx@593
Ritor1
parents:
diff changeset
2715 char v310; // sf@593
Ritor1
parents:
diff changeset
2716 unsigned __int8 v311; // of@593
Ritor1
parents:
diff changeset
2717 char v312; // cl@597
488
Nomad
parents: 486
diff changeset
2718 char v313; // al@606pGame->GetStru6()
0
Ritor1
parents:
diff changeset
2719 int v314; // edx@607
Ritor1
parents:
diff changeset
2720 int j; // esi@607
Ritor1
parents:
diff changeset
2721 unsigned int v316; // eax@613
Ritor1
parents:
diff changeset
2722 const char *v317; // ecx@617
Ritor1
parents:
diff changeset
2723 Player *v318; // ecx@619
Ritor1
parents:
diff changeset
2724 unsigned int v319; // edi@627
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2725 //int v320; // ecx@629
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2726 //int v321; // ecx@630
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2727 //int v322; // edi@632
0
Ritor1
parents:
diff changeset
2728 int v323; // edi@635
Ritor1
parents:
diff changeset
2729 char *v324; // eax@635
Ritor1
parents:
diff changeset
2730 Player *v325; // ecx@640
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2731 //int v326; // eax@643
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2732 //int v327; // eax@648
0
Ritor1
parents:
diff changeset
2733 int v328; // ecx@651
Ritor1
parents:
diff changeset
2734 int v329; // ecx@652
Ritor1
parents:
diff changeset
2735 int v330; // edi@654
488
Nomad
parents: 486
diff changeset
2736 //__int16 v331; // ST18_2@658
Nomad
parents: 486
diff changeset
2737 //stru6 *v332; // eax@658
Nomad
parents: 486
diff changeset
2738 //__int16 v333; // ST18_2@658
Nomad
parents: 486
diff changeset
2739 //stru6 *v334; // eax@658
Nomad
parents: 486
diff changeset
2740 //__int16 v335; // ST18_2@658
Nomad
parents: 486
diff changeset
2741 //stru6 *v336; // eax@658
Nomad
parents: 486
diff changeset
2742 //__int16 v337; // ST18_2@658
Nomad
parents: 486
diff changeset
2743 //stru6 *v338; // eax@658
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2744 //int v339; // ecx@659
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2745 //int v340; // ecx@660
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2746 //int v341; // eax@663
0
Ritor1
parents:
diff changeset
2747 signed int v342; // edi@668
Ritor1
parents:
diff changeset
2748 signed int v343; // edi@670
Ritor1
parents:
diff changeset
2749 unsigned __int64 v344; // ST08_8@670
488
Nomad
parents: 486
diff changeset
2750 //__int16 v345; // ST1C_2@671
Nomad
parents: 486
diff changeset
2751 //__int16 v346; // ST18_2@671
Nomad
parents: 486
diff changeset
2752 //stru6 *v347; // eax@671
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2753 //int v348; // ecx@672
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2754 //int v349; // ecx@673
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2755 //int v350; // edi@676
0
Ritor1
parents:
diff changeset
2756 Player *v351; // edi@680
488
Nomad
parents: 486
diff changeset
2757 //__int16 v352; // ST18_2@685
Nomad
parents: 486
diff changeset
2758 //stru6 *v353; // eax@685
0
Ritor1
parents:
diff changeset
2759 int v354; // ecx@686
Ritor1
parents:
diff changeset
2760 int v355; // ecx@687
Ritor1
parents:
diff changeset
2761 int v356; // eax@689
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
2762 Player *v357; // edi@694
488
Nomad
parents: 486
diff changeset
2763 //unsigned __int16 v358; // ST1C_2@695
Nomad
parents: 486
diff changeset
2764 //__int16 v359; // ST18_2@695
Nomad
parents: 486
diff changeset
2765 //stru6 *v360; // eax@695
Nomad
parents: 486
diff changeset
2766 //__int16 v361; // ST1C_2@697
Nomad
parents: 486
diff changeset
2767 //__int16 v362; // ST18_2@697
Nomad
parents: 486
diff changeset
2768 //stru6 *v363; // eax@697
0
Ritor1
parents:
diff changeset
2769 int v364; // ecx@698
Ritor1
parents:
diff changeset
2770 int v365; // ecx@699
Ritor1
parents:
diff changeset
2771 int v366; // eax@701
488
Nomad
parents: 486
diff changeset
2772 //stru6 *v367; // eax@704
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2773 //int v368; // eax@704
0
Ritor1
parents:
diff changeset
2774 Actor *v369; // edi@705
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2775 //int v370; // eax@706
0
Ritor1
parents:
diff changeset
2776 int v371; // ecx@709
Ritor1
parents:
diff changeset
2777 int v372; // ecx@710
Ritor1
parents:
diff changeset
2778 int v373; // eax@715
Ritor1
parents:
diff changeset
2779 int v374; // eax@717
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2780 //Player *v375; // edi@717
0
Ritor1
parents:
diff changeset
2781 int v376; // eax@717
Ritor1
parents:
diff changeset
2782 Player *v377; // ecx@719
Ritor1
parents:
diff changeset
2783 int v378; // ecx@721
Ritor1
parents:
diff changeset
2784 int v379; // ecx@722
Ritor1
parents:
diff changeset
2785 int v380; // eax@724
Ritor1
parents:
diff changeset
2786 int v381; // edi@727
Ritor1
parents:
diff changeset
2787 int v382; // ecx@727
Ritor1
parents:
diff changeset
2788 Player *v383; // eax@728
Ritor1
parents:
diff changeset
2789 int v384; // eax@733
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2790 //int v385; // edi@736
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2791 //signed int v386; // eax@736
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2792 //Player *v387; // edi@738
0
Ritor1
parents:
diff changeset
2793 int v388; // edi@740
488
Nomad
parents: 486
diff changeset
2794 //unsigned __int16 v389; // ST1C_2@740
Nomad
parents: 486
diff changeset
2795 //__int16 v390; // ST18_2@740
Nomad
parents: 486
diff changeset
2796 //stru6 *v391; // eax@740
0
Ritor1
parents:
diff changeset
2797 int v392; // ecx@742
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2798 //int v393; // ecx@743
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2799 //int v394; // ecx@744
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2800 //int v395; // edi@747
0
Ritor1
parents:
diff changeset
2801 int v396; // eax@752
Ritor1
parents:
diff changeset
2802 int v397; // eax@757
Ritor1
parents:
diff changeset
2803 int v398; // eax@757
Ritor1
parents:
diff changeset
2804 int v399; // eax@757
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2805 //char *v400; // esi@757
488
Nomad
parents: 486
diff changeset
2806 //Game *v401; // ecx@759
Nomad
parents: 486
diff changeset
2807 //__int16 v402; // ST1C_2@759
Nomad
parents: 486
diff changeset
2808 //__int16 v403; // ST18_2@759
Nomad
parents: 486
diff changeset
2809 //stru6 *v404; // eax@759
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2810 //int v405; // ecx@761
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2811 //int v406; // ecx@762
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2812 //int v407; // edi@765
488
Nomad
parents: 486
diff changeset
2813 //__int16 v408; // ST1C_2@769
Nomad
parents: 486
diff changeset
2814 //__int16 v409; // ST18_2@769
Nomad
parents: 486
diff changeset
2815 //stru6 *v410; // eax@769
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2816 //int v411; // ecx@772
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2817 //int v412; // ecx@773
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2818 //int v413; // edi@775
488
Nomad
parents: 486
diff changeset
2819 //__int16 v414; // ST1C_2@781
Nomad
parents: 486
diff changeset
2820 //__int16 v415; // ST18_2@781
Nomad
parents: 486
diff changeset
2821 //stru6 *v416; // eax@781
0
Ritor1
parents:
diff changeset
2822 int v417; // eax@787
Ritor1
parents:
diff changeset
2823 int v418; // ecx@789
Ritor1
parents:
diff changeset
2824 __int16 v419; // ax@791
Ritor1
parents:
diff changeset
2825 signed int v420; // eax@793
Ritor1
parents:
diff changeset
2826 int v421; // edx@793
Ritor1
parents:
diff changeset
2827 const char *v422; // eax@801
Ritor1
parents:
diff changeset
2828 int v423; // ecx@808
Ritor1
parents:
diff changeset
2829 int v424; // ecx@809
Ritor1
parents:
diff changeset
2830 int v425; // eax@811
Ritor1
parents:
diff changeset
2831 signed int v426; // eax@815
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2832 //signed int v427; // eax@820
0
Ritor1
parents:
diff changeset
2833 int v428; // ecx@825
Ritor1
parents:
diff changeset
2834 int v429; // ecx@826
Ritor1
parents:
diff changeset
2835 int v430; // eax@828
488
Nomad
parents: 486
diff changeset
2836 //stru6 *v431; // eax@831
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2837 //int v432; // eax@831
0
Ritor1
parents:
diff changeset
2838 Actor *v433; // edi@832
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2839 //int v434; // eax@833
0
Ritor1
parents:
diff changeset
2840 int v435; // ecx@837
Ritor1
parents:
diff changeset
2841 int v436; // ecx@838
488
Nomad
parents: 486
diff changeset
2842 //__int16 v437; // ST1C_2@843
Nomad
parents: 486
diff changeset
2843 //__int16 v438; // ST18_2@843
Nomad
parents: 486
diff changeset
2844 //stru6 *v439; // eax@843
0
Ritor1
parents:
diff changeset
2845 int v440; // eax@843
Ritor1
parents:
diff changeset
2846 int v441; // eax@847
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2847 //int v442; // ecx@850
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2848 //int v443; // ecx@851
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2849 //int v444; // eax@853
0
Ritor1
parents:
diff changeset
2850 signed int v445; // edi@857
Ritor1
parents:
diff changeset
2851 int v446; // ecx@862
Ritor1
parents:
diff changeset
2852 LevelDecoration *v447; // edi@864
Ritor1
parents:
diff changeset
2853 __int16 v448; // ax@864
Ritor1
parents:
diff changeset
2854 char *v449; // esi@870
Ritor1
parents:
diff changeset
2855 int v450; // eax@870
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2856 //int v451; // ecx@875
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2857 //int v452; // ecx@876
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2858 //int v453; // edi@878
488
Nomad
parents: 486
diff changeset
2859 //__int16 v454; // ST1C_2@884
Nomad
parents: 486
diff changeset
2860 //__int16 v455; // ST18_2@884
Nomad
parents: 486
diff changeset
2861 //stru6 *v456; // eax@884
0
Ritor1
parents:
diff changeset
2862 int v457; // ecx@887
Ritor1
parents:
diff changeset
2863 int v458; // ecx@888
Ritor1
parents:
diff changeset
2864 int v459; // eax@890
Ritor1
parents:
diff changeset
2865 signed int v460; // eax@895
Ritor1
parents:
diff changeset
2866 Actor *v461; // eax@897
Ritor1
parents:
diff changeset
2867 unsigned __int16 v462; // cx@897
Ritor1
parents:
diff changeset
2868 signed int v463; // edx@897
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2869 //int v464; // ecx@905
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2870 //int v465; // ecx@906
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2871 //int v466; // edi@909
488
Nomad
parents: 486
diff changeset
2872 //__int16 v467; // ST1C_2@913
Nomad
parents: 486
diff changeset
2873 //__int16 v468; // ST18_2@913
Nomad
parents: 486
diff changeset
2874 //stru6 *v469; // eax@913
0
Ritor1
parents:
diff changeset
2875 int v470; // edi@913
Ritor1
parents:
diff changeset
2876 int v471; // eax@917
Ritor1
parents:
diff changeset
2877 int v472; // eax@917
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2878 //char *v473; // esi@918
488
Nomad
parents: 486
diff changeset
2879 //__int16 v474; // ST18_2@920
Nomad
parents: 486
diff changeset
2880 //stru6 *v475; // eax@920
Nomad
parents: 486
diff changeset
2881 //__int16 v476; // ST18_2@920
Nomad
parents: 486
diff changeset
2882 //stru6 *v477; // eax@920
Nomad
parents: 486
diff changeset
2883 //__int16 v478; // ST18_2@920
Nomad
parents: 486
diff changeset
2884 //stru6 *v479; // eax@920
Nomad
parents: 486
diff changeset
2885 //__int16 v480; // ST18_2@920
Nomad
parents: 486
diff changeset
2886 //stru6 *v481; // eax@920
Nomad
parents: 486
diff changeset
2887 //__int16 v482; // ST18_2@923
Nomad
parents: 486
diff changeset
2888 //stru6 *v483; // eax@923
Nomad
parents: 486
diff changeset
2889 //__int16 v484; // ST18_2@923
Nomad
parents: 486
diff changeset
2890 //stru6 *v485; // eax@923
Nomad
parents: 486
diff changeset
2891 //__int16 v486; // ST18_2@923
Nomad
parents: 486
diff changeset
2892 //stru6 *v487; // eax@923
Nomad
parents: 486
diff changeset
2893 //__int16 v488; // ST18_2@923
Nomad
parents: 486
diff changeset
2894 //stru6 *v489; // eax@923
Nomad
parents: 486
diff changeset
2895 //__int16 v490; // ST1C_2@924
Nomad
parents: 486
diff changeset
2896 //__int16 v491; // ST18_2@924
Nomad
parents: 486
diff changeset
2897 //stru6 *v492; // eax@924
0
Ritor1
parents:
diff changeset
2898 int v493; // ecx@925
Ritor1
parents:
diff changeset
2899 int v494; // ecx@926
488
Nomad
parents: 486
diff changeset
2900 //__int16 v495; // ST1C_2@931
Nomad
parents: 486
diff changeset
2901 //__int16 v496; // ST18_2@931
Nomad
parents: 486
diff changeset
2902 //stru6 *v497; // eax@931
0
Ritor1
parents:
diff changeset
2903 int v498; // edi@931
Ritor1
parents:
diff changeset
2904 int v499; // eax@935
Ritor1
parents:
diff changeset
2905 int v500; // eax@935
Ritor1
parents:
diff changeset
2906 Player *v501; // edi@939
488
Nomad
parents: 486
diff changeset
2907 //__int16 v502; // ST18_2@940
Nomad
parents: 486
diff changeset
2908 //stru6 *v503; // eax@940
Nomad
parents: 486
diff changeset
2909 //stru6 *v504; // eax@943
0
Ritor1
parents:
diff changeset
2910 int v505; // eax@943
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2911 //int v506; // eax@943
0
Ritor1
parents:
diff changeset
2912 int v507; // edi@944
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2913 //int v508; // eax@944
0
Ritor1
parents:
diff changeset
2914 signed int v509; // eax@944
Ritor1
parents:
diff changeset
2915 signed int v510; // edi@944
Ritor1
parents:
diff changeset
2916 Actor *v511; // edi@946
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2917 //int v512; // eax@946
0
Ritor1
parents:
diff changeset
2918 SpellBuff *v513; // edi@946
Ritor1
parents:
diff changeset
2919 int v514; // ecx@950
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2920 //int v515; // ecx@951
0
Ritor1
parents:
diff changeset
2921 int v516; // eax@953
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2922 //int v517; // eax@956
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
2923 Actor *v518; // edx@957
0
Ritor1
parents:
diff changeset
2924 __int16 v519; // cx@958
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2925 //int v520; // ecx@968
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2926 //int v521; // ecx@969
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2927 //int v522; // eax@971
488
Nomad
parents: 486
diff changeset
2928 //__int16 v523; // ST18_2@975
Nomad
parents: 486
diff changeset
2929 //stru6 *v524; // eax@975
Nomad
parents: 486
diff changeset
2930 //__int16 v525; // ST18_2@975
Nomad
parents: 486
diff changeset
2931 //stru6 *v526; // eax@975
Nomad
parents: 486
diff changeset
2932 //__int16 v527; // ST18_2@975
Nomad
parents: 486
diff changeset
2933 //stru6 *v528; // eax@975
Nomad
parents: 486
diff changeset
2934 //__int16 v529; // ST18_2@975
Nomad
parents: 486
diff changeset
2935 //stru6 *v530; // eax@975
0
Ritor1
parents:
diff changeset
2936 int v531; // eax@982
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2937 //int v532; // eax@982
0
Ritor1
parents:
diff changeset
2938 int v533; // edi@983
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2939 //int v534; // eax@983
0
Ritor1
parents:
diff changeset
2940 signed int v535; // eax@983
Ritor1
parents:
diff changeset
2941 signed int v536; // edi@983
Ritor1
parents:
diff changeset
2942 stru6 *v537; // eax@984
Ritor1
parents:
diff changeset
2943 int v538; // ecx@985
Ritor1
parents:
diff changeset
2944 int v539; // ecx@986
Ritor1
parents:
diff changeset
2945 int v540; // eax@988
488
Nomad
parents: 486
diff changeset
2946 //__int16 v541; // ST18_2@991
Nomad
parents: 486
diff changeset
2947 //stru6 *v542; // eax@991
Nomad
parents: 486
diff changeset
2948 //__int16 v543; // ST18_2@991
Nomad
parents: 486
diff changeset
2949 //stru6 *v544; // eax@991
Nomad
parents: 486
diff changeset
2950 //__int16 v545; // ST18_2@991
Nomad
parents: 486
diff changeset
2951 //stru6 *v546; // eax@991
Nomad
parents: 486
diff changeset
2952 //__int16 v547; // ST18_2@991
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2953 //stru6 *v548; // eax@991
0
Ritor1
parents:
diff changeset
2954 double v549; // st7@991
Ritor1
parents:
diff changeset
2955 unsigned __int16 v550; // di@991
Ritor1
parents:
diff changeset
2956 int v551; // ecx@993
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2957 //int v552; // ecx@994
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
2958 Player *v553; // edi@1001
488
Nomad
parents: 486
diff changeset
2959 //__int16 v554; // ST18_2@1002
Nomad
parents: 486
diff changeset
2960 //stru6 *v555; // eax@1002
Nomad
parents: 486
diff changeset
2961 //__int16 v556; // ST18_2@1002
Nomad
parents: 486
diff changeset
2962 //stru6 *v557; // eax@1002
Nomad
parents: 486
diff changeset
2963 //__int16 v558; // ST18_2@1002
Nomad
parents: 486
diff changeset
2964 //stru6 *v559; // eax@1002
Nomad
parents: 486
diff changeset
2965 //__int16 v560; // ST18_2@1002
Nomad
parents: 486
diff changeset
2966 //stru6 *v561; // eax@1002
0
Ritor1
parents:
diff changeset
2967 unsigned __int16 v562; // di@1005
Ritor1
parents:
diff changeset
2968 signed int v563; // eax@1010
Ritor1
parents:
diff changeset
2969 unsigned int v564; // ecx@1011
Ritor1
parents:
diff changeset
2970 signed int v565; // eax@1012
Ritor1
parents:
diff changeset
2971 Player **v566; // ecx@1012
Ritor1
parents:
diff changeset
2972 int v567; // eax@1012
488
Nomad
parents: 486
diff changeset
2973 //unsigned __int16 v568; // ST1C_2@1012
Nomad
parents: 486
diff changeset
2974 //__int16 v569; // ST18_2@1012
Nomad
parents: 486
diff changeset
2975 //stru6 *v570; // eax@1012
0
Ritor1
parents:
diff changeset
2976 Player *v571; // eax@1013
Ritor1
parents:
diff changeset
2977 char *v572; // ecx@1013
Ritor1
parents:
diff changeset
2978 int v573; // ecx@1017
Ritor1
parents:
diff changeset
2979 int v574; // ecx@1018
Ritor1
parents:
diff changeset
2980 int v575; // eax@1020
Ritor1
parents:
diff changeset
2981 signed int v576; // eax@1025
Ritor1
parents:
diff changeset
2982 Player *v577; // eax@1026
Ritor1
parents:
diff changeset
2983 int v578; // eax@1028
Ritor1
parents:
diff changeset
2984 __int16 v579; // ax@1029
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
2985 //int v580; // eax@1031
0
Ritor1
parents:
diff changeset
2986 int v581; // edi@1031
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
2987 //int v582; // eax@1031
488
Nomad
parents: 486
diff changeset
2988 //__int16 v583; // ST1C_2@1034
Nomad
parents: 486
diff changeset
2989 //__int16 v584; // ST18_2@1034
0
Ritor1
parents:
diff changeset
2990 char *v585; // esi@1034
488
Nomad
parents: 486
diff changeset
2991 //stru6 *v586; // eax@1034
0
Ritor1
parents:
diff changeset
2992 signed int v587; // eax@1035
Ritor1
parents:
diff changeset
2993 int v588; // ecx@1036
Ritor1
parents:
diff changeset
2994 int v589; // ecx@1037
Ritor1
parents:
diff changeset
2995 int v590; // ecx@1038
Ritor1
parents:
diff changeset
2996 char v591; // al@1048
Ritor1
parents:
diff changeset
2997 int v592; // esi@1052
Ritor1
parents:
diff changeset
2998 int v593; // ecx@1057
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
2999 //int v594; // ecx@1058
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
3000 //int v595; // eax@1064
0
Ritor1
parents:
diff changeset
3001 int v596; // esi@1066
Ritor1
parents:
diff changeset
3002 unsigned int v597; // edi@1067
Ritor1
parents:
diff changeset
3003 int v598; // eax@1079
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3004 //signed int v599; // eax@1082
0
Ritor1
parents:
diff changeset
3005 int v600; // edi@1086
Ritor1
parents:
diff changeset
3006 int v601; // edx@1086
Ritor1
parents:
diff changeset
3007 int v602; // eax@1086
Ritor1
parents:
diff changeset
3008 int v603; // ecx@1086
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
3009 //int v604; // eax@1087
0
Ritor1
parents:
diff changeset
3010 char *v605; // eax@1089
Ritor1
parents:
diff changeset
3011 int v606; // edx@1091
Ritor1
parents:
diff changeset
3012 int v607; // ecx@1100
Ritor1
parents:
diff changeset
3013 __int16 v608; // ax@1102
Ritor1
parents:
diff changeset
3014 signed int v609; // eax@1104
Ritor1
parents:
diff changeset
3015 int v610; // edi@1106
Ritor1
parents:
diff changeset
3016 unsigned int v611; // eax@1106
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3017 Player *v612; // edi@1106
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3018 DDM_DLV_Header *v613; // eax@1108
0
Ritor1
parents:
diff changeset
3019 int v614; // eax@1116
Ritor1
parents:
diff changeset
3020 int v615; // edi@1119
488
Nomad
parents: 486
diff changeset
3021 //__int16 v616; // ST1C_2@1122
Nomad
parents: 486
diff changeset
3022 //__int16 v617; // ST18_2@1122
Nomad
parents: 486
diff changeset
3023 //stru6 *v618; // eax@1122
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3024 Player *v619; // edi@1123
488
Nomad
parents: 486
diff changeset
3025 //unsigned __int16 v620; // ST1C_2@1124
Nomad
parents: 486
diff changeset
3026 //__int16 v621; // ST18_2@1124
Nomad
parents: 486
diff changeset
3027 //stru6 *v622; // eax@1124
0
Ritor1
parents:
diff changeset
3028 signed __int64 v623; // qax@1127
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
3029 //int v624; // eax@1127
0
Ritor1
parents:
diff changeset
3030 int v625; // edi@1129
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3031 //int v626; // eax@1129
0
Ritor1
parents:
diff changeset
3032 signed int v627; // eax@1129
Ritor1
parents:
diff changeset
3033 signed int v628; // edi@1129
Ritor1
parents:
diff changeset
3034 int v629; // ecx@1130
Ritor1
parents:
diff changeset
3035 Player *v630; // eax@1131
Ritor1
parents:
diff changeset
3036 int v631; // eax@1137
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3037 //int v632; // edi@1140
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3038 //Player *v633; // eax@1140
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3039 //signed int v634; // eax@1140
0
Ritor1
parents:
diff changeset
3040 int v635; // edi@1142
488
Nomad
parents: 486
diff changeset
3041 //unsigned __int16 v636; // ST1C_2@1142
Nomad
parents: 486
diff changeset
3042 //__int16 v637; // ST18_2@1142
Nomad
parents: 486
diff changeset
3043 //stru6 *v638; // eax@1142
Nomad
parents: 486
diff changeset
3044 //stru6 *v639; // eax@1143
0
Ritor1
parents:
diff changeset
3045 int v640; // ecx@1146
Ritor1
parents:
diff changeset
3046 int v641; // ecx@1147
Ritor1
parents:
diff changeset
3047 int v642; // edi@1156
Ritor1
parents:
diff changeset
3048 int v643; // eax@1156
Ritor1
parents:
diff changeset
3049 int v644; // eax@1156
Ritor1
parents:
diff changeset
3050 signed int v645; // eax@1158
488
Nomad
parents: 486
diff changeset
3051 //Player *v646; // ebx@1169
Nomad
parents: 486
diff changeset
3052 //int v647; // edi@1169
Nomad
parents: 486
diff changeset
3053 //signed int v648; // ST1C_4@1170
Nomad
parents: 486
diff changeset
3054 //Player *v649; // ecx@1170
Nomad
parents: 486
diff changeset
3055 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103
Nomad
parents: 486
diff changeset
3056 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100
Nomad
parents: 486
diff changeset
3057 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304
Nomad
parents: 486
diff changeset
3058 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3059 //int v654; // [sp-4h] [bp-E88h]@124
488
Nomad
parents: 486
diff changeset
3060 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304
0
Ritor1
parents:
diff changeset
3061 unsigned int v656; // [sp-4h] [bp-E88h]@639
Ritor1
parents:
diff changeset
3062 int v657; // [sp-4h] [bp-E88h]@807
488
Nomad
parents: 486
diff changeset
3063 //int v658; // [sp+0h] [bp-E84h]@100
0
Ritor1
parents:
diff changeset
3064 int v659; // [sp+0h] [bp-E84h]@123
Ritor1
parents:
diff changeset
3065 int v660; // [sp+0h] [bp-E84h]@146
Ritor1
parents:
diff changeset
3066 Actor *v661; // [sp+0h] [bp-E84h]@164
488
Nomad
parents: 486
diff changeset
3067 //int v662; // [sp+0h] [bp-E84h]@304
0
Ritor1
parents:
diff changeset
3068 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639
Ritor1
parents:
diff changeset
3069 const char *v664; // [sp+0h] [bp-E84h]@802
Ritor1
parents:
diff changeset
3070 int v665; // [sp+0h] [bp-E84h]@807
Ritor1
parents:
diff changeset
3071 int v666; // [sp+4h] [bp-E80h]@12
821
5e3f4bf3b8e6 * UpdateActorAI clean
zipi
parents: 819
diff changeset
3072 PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25
488
Nomad
parents: 486
diff changeset
3073 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3074 //int v669; // [sp+4h] [bp-E80h]@123
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3075 //Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133
0
Ritor1
parents:
diff changeset
3076 int v671; // [sp+4h] [bp-E80h]@146
Ritor1
parents:
diff changeset
3077 unsigned int v672; // [sp+4h] [bp-E80h]@164
488
Nomad
parents: 486
diff changeset
3078 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3079 //__int16 v674; // [sp+4h] [bp-E80h]@684
0
Ritor1
parents:
diff changeset
3080 const char *v675; // [sp+4h] [bp-E80h]@800
Ritor1
parents:
diff changeset
3081 int v676; // [sp+4h] [bp-E80h]@807
Ritor1
parents:
diff changeset
3082 int v677; // [sp+4h] [bp-E80h]@861
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3083 //int v678; // [sp+4h] [bp-E80h]@997
0
Ritor1
parents:
diff changeset
3084 int v679; // [sp+14h] [bp-E70h]@515
Ritor1
parents:
diff changeset
3085 AIDirection a3; // [sp+C94h] [bp-1F0h]@21
Ritor1
parents:
diff changeset
3086 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137
Ritor1
parents:
diff changeset
3087 int v682[4]; // [sp+CC0h] [bp-1C4h]@731
Ritor1
parents:
diff changeset
3088 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791
Ritor1
parents:
diff changeset
3089 int v684; // [sp+D04h] [bp-180h]@416
Ritor1
parents:
diff changeset
3090 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416
Ritor1
parents:
diff changeset
3091 int x; // [sp+D20h] [bp-164h]@327
Ritor1
parents:
diff changeset
3092 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3093 Vec3_int_ v688; // [sp+D2Ch] [bp-158h]@943
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3094 //int v689; // [sp+D30h] [bp-154h]@943
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3095 //int v690; // [sp+D34h] [bp-150h]@943
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3096 Vec3_int_ v691; // [sp+D38h] [bp-14Ch]@137
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3097 //int v692; // [sp+D3Ch] [bp-148h]@137
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3098 //int v693; // [sp+D40h] [bp-144h]@137
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3099 Vec3_int_ v694; // [sp+D44h] [bp-140h]@982
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3100 //int v695; // [sp+D48h] [bp-13Ch]@982
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3101 //int v696; // [sp+D4Ch] [bp-138h]@982
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3102 Vec3_int_ v697; // [sp+D50h] [bp-134h]@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3103 //int v698; // [sp+D54h] [bp-130h]@129
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3104 //int v699; // [sp+D58h] [bp-12Ch]@129
0
Ritor1
parents:
diff changeset
3105 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3106 Vec3_int_ v701; // [sp+D68h] [bp-11Ch]@286
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3107 //int v702; // [sp+D6Ch] [bp-118h]@286
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3108 //int v703; // [sp+D70h] [bp-114h]@286
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3109 Vec3_int_ v704; // [sp+D74h] [bp-110h]@132
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3110 //int v705; // [sp+D78h] [bp-10Ch]@132
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3111 //int v706; // [sp+D7Ch] [bp-108h]@132
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3112 Vec3_int_ v707; // [sp+D80h] [bp-104h]@1127
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3113 //int v708; // [sp+D84h] [bp-100h]@1127
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3114 //int v709; // [sp+D88h] [bp-FCh]@1127
0
Ritor1
parents:
diff changeset
3115 char v710; // [sp+D8Ch] [bp-F8h]@1156
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3116 //stru277 *v711; // [sp+D90h] [bp-F4h]@1
0
Ritor1
parents:
diff changeset
3117 __int64 v712; // [sp+D94h] [bp-F0h]@991
Ritor1
parents:
diff changeset
3118 int v713; // [sp+D9Ch] [bp-E8h]@324
Ritor1
parents:
diff changeset
3119 int n; // [sp+DA0h] [bp-E4h]@1
Ritor1
parents:
diff changeset
3120 AIDirection v715; // [sp+DA4h] [bp-E0h]@21
Ritor1
parents:
diff changeset
3121 int v716; // [sp+DC0h] [bp-C4h]@272
Ritor1
parents:
diff changeset
3122 __int64 v717; // [sp+DC4h] [bp-C0h]@271
Ritor1
parents:
diff changeset
3123 float v718; // [sp+DCCh] [bp-B8h]@176
Ritor1
parents:
diff changeset
3124 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53
Ritor1
parents:
diff changeset
3125 char *y; // [sp+DD4h] [bp-B0h]@325
Ritor1
parents:
diff changeset
3126 int v721; // [sp+DD8h] [bp-ACh]@163
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
3127 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1
0
Ritor1
parents:
diff changeset
3128 int v723; // [sp+E4Ch] [bp-38h]@1
Ritor1
parents:
diff changeset
3129 ItemGen *_this; // [sp+E50h] [bp-34h]@23
Ritor1
parents:
diff changeset
3130 float v725; // [sp+E54h] [bp-30h]@23
Ritor1
parents:
diff changeset
3131 Player *v726; // [sp+E58h] [bp-2Ch]@131
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3132 //int v726b;
0
Ritor1
parents:
diff changeset
3133 float v727; // [sp+E5Ch] [bp-28h]@1
Ritor1
parents:
diff changeset
3134 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53
Ritor1
parents:
diff changeset
3135 Player *pPlayer; // [sp+E64h] [bp-20h]@8
Ritor1
parents:
diff changeset
3136 int v730; // [sp+E68h] [bp-1Ch]@53
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3137 Player *v730b;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3138 ItemGen *v730c;
0
Ritor1
parents:
diff changeset
3139 int v731; // [sp+E6Ch] [bp-18h]@48
Ritor1
parents:
diff changeset
3140 signed int v732; // [sp+E70h] [bp-14h]@325
Ritor1
parents:
diff changeset
3141 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1
Ritor1
parents:
diff changeset
3142 signed int a2; // [sp+E7Ch] [bp-8h]@14
Ritor1
parents:
diff changeset
3143 int amount; // [sp+E80h] [bp-4h]@1
Ritor1
parents:
diff changeset
3144
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3145 //auto ecx0 = this;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3146
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3147 //v711 = ecx0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3148
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3149 SpriteObject pSpellSprite; // [sp+DDCh] [bp-A8h]@1
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
3150 //SpriteObject::SpriteObject(&a1);
0
Ritor1
parents:
diff changeset
3151
486
Nomad
parents: 482
diff changeset
3152 //v1 = 0;
0
Ritor1
parents:
diff changeset
3153 v2 = 0;
Ritor1
parents:
diff changeset
3154 amount = 0;
Ritor1
parents:
diff changeset
3155 LODWORD(v733) = 0;
Ritor1
parents:
diff changeset
3156 v723 = 0;
Ritor1
parents:
diff changeset
3157 v727 = 0.0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3158 for(n = 0; n < 10; ++n)
0
Ritor1
parents:
diff changeset
3159 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3160 pCastSpell = &this[n];
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3161 HIDWORD(v733) = (int)pCastSpell;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3162 if ( pCastSpell->spellnum == 0 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3163 continue;
486
Nomad
parents: 482
diff changeset
3164
Nomad
parents: 482
diff changeset
3165 if (pParty->Invisible())
Nomad
parents: 482
diff changeset
3166 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
Nomad
parents: 482
diff changeset
3167
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3168 if ( pCastSpell->field_8 & 0x3CA )
0
Ritor1
parents:
diff changeset
3169 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3170 if ( !pParty->pPlayers[pCastSpell->uPlayerID].CanAct() )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3171 this->_427D48(1);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3172 continue;
0
Ritor1
parents:
diff changeset
3173 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3174 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3175
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3176 a2 = pCastSpell->spell_target_pid;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3177 if (!pCastSpell->spell_target_pid)
0
Ritor1
parents:
diff changeset
3178 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3179 if (pCastSpell->spellnum == SPELL_LIGHT_DESTROY_UNDEAD ||
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3180 pCastSpell->spellnum == SPELL_SPIRIT_TURN_UNDEAD ||
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3181 pCastSpell->spellnum == SPELL_DARK_CONTROL_UNDEAD )
488
Nomad
parents: 486
diff changeset
3182 v666 = 1;
Nomad
parents: 486
diff changeset
3183 else
Nomad
parents: 486
diff changeset
3184 v666 = 0;
Nomad
parents: 486
diff changeset
3185
Nomad
parents: 486
diff changeset
3186 a2 = stru_50C198.FindClosestActor(5120, 1, v666);
Nomad
parents: 486
diff changeset
3187 v6 = pMouse->uPointingObjectID;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3188 if ( pMouse->uPointingObjectID && PID_TYPE(v6) == OBJECT_Actor && pActors[PID_ID(v6)].CanAct() )
488
Nomad
parents: 486
diff changeset
3189 a2 = pMouse->uPointingObjectID;
0
Ritor1
parents:
diff changeset
3190 }
488
Nomad
parents: 486
diff changeset
3191
Nomad
parents: 486
diff changeset
3192
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3193 pSpellSprite.uType = stru_4E3ACC[pCastSpell->spellnum].uType;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3194 if (pSpellSprite.uType)
0
Ritor1
parents:
diff changeset
3195 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
3196 if (PID_TYPE(a2) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
3197 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3198 memcpy(&v715, Actor::GetDirectionInfo(PID(OBJECT_Player, pCastSpell->uPlayerID + 1), a2, &a3, 0), sizeof(v715));
0
Ritor1
parents:
diff changeset
3199 v2 = v723;
Ritor1
parents:
diff changeset
3200 }
Ritor1
parents:
diff changeset
3201 else
Ritor1
parents:
diff changeset
3202 {
Ritor1
parents:
diff changeset
3203 v715.uYawAngle = pParty->sRotationY;
Ritor1
parents:
diff changeset
3204 v715.uPitchAngle = pParty->sRotationX;
Ritor1
parents:
diff changeset
3205 }
Ritor1
parents:
diff changeset
3206 }
488
Nomad
parents: 486
diff changeset
3207
486
Nomad
parents: 482
diff changeset
3208 LODWORD(v725) = 0;
Nomad
parents: 482
diff changeset
3209 _this = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3210 if (pCastSpell->forced_spell_skill_level)
488
Nomad
parents: 486
diff changeset
3211 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3212 v11 = pCastSpell->forced_spell_skill_level;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3213 v723 = v11 & 0x3F; // 6 bytes
488
Nomad
parents: 486
diff changeset
3214 v2 = v723;
Nomad
parents: 486
diff changeset
3215 }
Nomad
parents: 486
diff changeset
3216 else
0
Ritor1
parents:
diff changeset
3217 {
488
Nomad
parents: 486
diff changeset
3218 //v667 = PLAYER_SKILL_STAFF;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3219 if (pCastSpell->spellnum < SPELL_AIR_WIZARD_EYE)
488
Nomad
parents: 486
diff changeset
3220 v667 = PLAYER_SKILL_FIRE;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3221 else if (pCastSpell->spellnum < SPELL_WATER_AWAKEN)
488
Nomad
parents: 486
diff changeset
3222 v667 = PLAYER_SKILL_AIR;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3223 else if (pCastSpell->spellnum < SPELL_EARTH_STUN)
488
Nomad
parents: 486
diff changeset
3224 v667 = PLAYER_SKILL_WATER;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3225 else if (pCastSpell->spellnum < SPELL_SPIRIT_DETECT_LIFE)
488
Nomad
parents: 486
diff changeset
3226 v667 = PLAYER_SKILL_EARTH;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3227 else if (pCastSpell->spellnum < SPELL_MIND_REMOVE_FEAR)
488
Nomad
parents: 486
diff changeset
3228 v667 = PLAYER_SKILL_SPIRIT;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3229 else if (pCastSpell->spellnum < SPELL_BODY_CURE_WEAKNESS)
488
Nomad
parents: 486
diff changeset
3230 v667 = PLAYER_SKILL_MIND;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3231 else if (pCastSpell->spellnum < SPELL_LIGHT_LIGHT_BOLT)
488
Nomad
parents: 486
diff changeset
3232 v667 = PLAYER_SKILL_BODY;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3233 else if (pCastSpell->spellnum < SPELL_DARK_REANIMATE)
488
Nomad
parents: 486
diff changeset
3234 v667 = PLAYER_SKILL_LIGHT;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3235 else if (pCastSpell->spellnum < SPELL_BOW_ARROW)
488
Nomad
parents: 486
diff changeset
3236 v667 = PLAYER_SKILL_DARK;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3237 else if (pCastSpell->spellnum == SPELL_BOW_ARROW)
488
Nomad
parents: 486
diff changeset
3238 v667 = PLAYER_SKILL_BOW;
Nomad
parents: 486
diff changeset
3239 else assert(false && "Unknown spell");
Nomad
parents: 486
diff changeset
3240
0
Ritor1
parents:
diff changeset
3241 LODWORD(v725) = v667;
488
Nomad
parents: 486
diff changeset
3242 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F;
Nomad
parents: 486
diff changeset
3243 v2 = v723;
Nomad
parents: 486
diff changeset
3244 v11 = pPlayer->pActiveSkills[LODWORD(v725)];
0
Ritor1
parents:
diff changeset
3245 }
488
Nomad
parents: 486
diff changeset
3246
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3247 v731 = SkillToMastery(v11);
488
Nomad
parents: 486
diff changeset
3248
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3249 if (pCastSpell->forced_spell_skill_level)
486
Nomad
parents: 482
diff changeset
3250 uRequiredMana = 0;
488
Nomad
parents: 486
diff changeset
3251 else
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3252 uRequiredMana = pSpellDatas[pCastSpell->spellnum].mana_per_skill[v731 - 1];
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3253 sRecoveryTime = pSpellDatas[pCastSpell->spellnum].recovery_per_skill[v731 - 1];
488
Nomad
parents: 486
diff changeset
3254
Nomad
parents: 486
diff changeset
3255 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
490
Nomad
parents: 488
diff changeset
3256 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)
486
Nomad
parents: 482
diff changeset
3257 uRequiredMana = 0;
488
Nomad
parents: 486
diff changeset
3258
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3259 if (pCastSpell->spellnum < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana)
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3260 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3261 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points"
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3262 pCastSpell->spellnum = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3263 continue;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3264 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3265 v730 = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3266 if (pPlayer->Cursed() && pCastSpell->spellnum < SPELL_BOW_ARROW && rand() % 100 < 50)
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3267 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3268 if (!pParty->bTurnBasedModeOn)
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3269 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3270 //v646 = pPlayer;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3271 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3272 //v647 = n;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3273 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3274 else
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3275 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3276 //v647 = n;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3277 //v646 = pPlayer;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3278 //v648 = sRecoveryTime;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3279 //v649 = pPlayer;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3280 pParty->pTurnBasedPlayerRecoveryTimes[this[n].uPlayerID] = 100;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3281 pPlayer->SetRecoveryTime(sRecoveryTime);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3282 pTurnEngine->_40471C();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3283 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3284 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed"
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3285 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3286 this[n].spellnum = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3287 pPlayer->sMana -= uRequiredMana;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3288 return;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3289 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3290
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3291 switch ( pCastSpell->spellnum )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3292 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3293 case SPELL_101:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3294 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3295 case SPELL_BOW_ARROW:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3296 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
3297 //v17 = pPlayer;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3298 _this = (ItemGen *)1;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3299 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3300 _this = (ItemGen *)2;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
3301 sRecoveryTime = pPlayer->GetAttackRecoveryTime(true);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3302 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3303 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3304 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3305 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3306 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
3307 if ( pPlayer->WearsItem(510, 2) )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3308 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3309 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3310 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3311 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3312 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3313 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3314 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3315 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3316 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3317 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3318 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3319 v20 = &pParty->pPlayers[pCastSpell->uPlayerID];
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3320 memcpy(&pSpellSprite.stru_24, &v20[v20->pEquipment.uBow], sizeof(pSpellSprite.stru_24));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3321 pSpellSprite.uAttributes = 256;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3322 if ( pParty->bTurnBasedModeOn == 1 )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3323 pSpellSprite.uAttributes = 260;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3324 for ( i = 0; i < (signed int)_this; ++i )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3325 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3326 if ( i )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3327 pSpellSprite.vPosition.z += 32;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3328 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3329 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3330 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3331 ++pTurnEngine->field_1C;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3332 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3333 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3334 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3335 case SPELL_LASER_PROJECTILE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3336 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3337 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3338 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3339 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3340 pSpellSprite.spell_level = v723;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3341 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3342 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3343 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3344 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3345 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3346 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3347 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3348 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3349 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3350 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3351 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3352 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3353 memcpy(&pSpellSprite.stru_24,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3354 &pParty->pPlayers[pCastSpell->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3355 * pParty->pPlayers[pCastSpell->uPlayerID].pEquipment.uMainHand + 5], sizeof(pSpellSprite.stru_24));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3356 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3357 HIBYTE(pSpellSprite.uAttributes) |= 1u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3358 pSpellSprite.uSectorID = v23;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3359 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3360 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3361 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3362 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3363 ++pTurnEngine->field_1C;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3364 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3365 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3366 case SPELL_FIRE_TORCH_LIGHT:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3367 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3368 LODWORD(v733) = 3600 * v2;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3369
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3370 switch (v731)
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3371 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3372 case 1: amount = 2; break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3373 case 2: amount = 3; break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3374 case 3:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3375 case 4: amount = 4; break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3376 default:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3377 assert(false);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3378 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3379 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3380 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3381 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3382 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3383 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3384 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3385 case SPELL_FIRE_FIRE_SPIKE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3386 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3387 v29 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3388 if ( v29 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3389 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3390 v30 = v29 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3391 if ( v30 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3392 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3393 if ( v30 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3394 amount = 9;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3395 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3396 amount = 3;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3397 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3398 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3399 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3400 amount = 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3401 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3402 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3403 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3404 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3405 amount = 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3406 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3407 //v31 = v3->uPlayerID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3408 //v32 = 8 * v31;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3409 //LOBYTE(v32) = v32 | OBJECT_Player;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3410
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3411 //if ( (signed int)uNumSpriteObjects > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3412 int _v733 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3413 for (uint i = 0; i < uNumSpriteObjects; ++i)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3414 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3415 auto object = pSpriteObjects + i;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3416 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID))
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3417 ++_v733;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3418 /*v33 = (char *)&pSpriteObjects[0].field_48;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3419 v730 = uNumSpriteObjects;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3420 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3421 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3422 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3423 ++HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3424 v33 += 112;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3425 --v730;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3426 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3427 while ( v730 );*/
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3428 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3429 if (_v733 > amount)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3430 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3431 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3432 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3433 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3434 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3435 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3436 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3437 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3438 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3439 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3440 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3441 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3442 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3443 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3444 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3445 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3446 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3447 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3448 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3449 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3450 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3451 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3452 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3453 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3454 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3455 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3456 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3457 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX + 10, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3458 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3459 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3460 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3461 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3462 case SPELL_AIR_IMPLOSION:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3463 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3464 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3465 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3466 if (!a2)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3467 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3468 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3469 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3470 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3471 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3472 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3473 if (PID_TYPE(a2) != OBJECT_Actor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3474 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3475 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3476 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3477 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3478 v697.x = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3479 v697.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3480 v697.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3481 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3482 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3483 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3484 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3485 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3486 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3487 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3488 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3489 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3490 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3491 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3492 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3493 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3494 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3495 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3496 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3497 auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3498 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v697);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3499 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3500 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3501 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3502 case SPELL_EARTH_MASS_DISTORTION:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3503 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3504 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3505 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3506 if ( !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 3u) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3507 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3508 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3509 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3510 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3511 pActors[PID_ID(a2)].pActorBuffs[10].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3512 v704.x = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3513 v704.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3514 v704.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3515 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3516 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3517 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3518 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3519 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3520 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3521 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3522 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3523 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3524 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3525 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3526 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3527 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3528 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3529 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3530 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, (int)v726);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3531 auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3532 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v704);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3533 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3534 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3535 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3536 case SPELL_LIGHT_DESTROY_UNDEAD:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3537 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3538 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || PID_TYPE(a2) != OBJECT_Actor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3539 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3540 //v730 = a2 >> 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3541 //HIDWORD(v733) = (int)&pActors[PID_ID(a2)];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3542 v691.x = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3543 v691.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3544 v691.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3545 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3546 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3547 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3548 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3549 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3550 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3551 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3552 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3553 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3554 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3555 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3556 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3557 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3558 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3559 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3560 pSpellSprite.uAttributes |= 0x80u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3561 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3562 auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3563 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3564 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3565 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3566 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3567 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3568 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3569 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3570 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3571 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3572 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3573 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3574 case SPELL_FIRE_FIRE_BOLT:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3575 case SPELL_FIRE_FIREBALL:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3576 case SPELL_FIRE_INCINERATE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3577 case SPELL_AIR_LIGHNING_BOLT:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3578 case SPELL_WATER_ICE_BOLT:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3579 case SPELL_WATER_ICE_BLAST:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3580 case SPELL_EARTH_STUN:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3581 case SPELL_EARTH_DEADLY_SWARM:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3582 case SPELL_MIND_MIND_BLAST:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3583 case SPELL_MIND_PSYCHIC_SHOCK:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3584 case SPELL_BODY_HARM:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3585 case SPELL_LIGHT_LIGHT_BOLT:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3586 case SPELL_DARK_DRAGON_BREATH:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3587 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3588 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3589 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3590 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3591 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3592 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3593 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3594 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3595 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3596 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3597 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3598 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3599 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3600 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3601 else
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3602 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3603 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3604 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3605 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3606 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3607 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3608 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3609 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3610 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3611 if ( pCastSpell->spellnum == SPELL_AIR_LIGHNING_BOLT )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3612 LOBYTE(pSpellSprite.uAttributes) |= 0x40u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3613 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3614 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3615 ++pTurnEngine->field_1C;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3616 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3617 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3618 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3619 case SPELL_WATER_ACID_BURST:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3620 case SPELL_EARTH_BLADES:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3621 case SPELL_BODY_FLYING_FIST:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3622 case SPELL_DARK_TOXIC_CLOUD:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3623 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3624 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3625 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3626 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3627 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3628 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3629 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3630 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3631 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3632 pSpellSprite.vPosition.y = pParty->vPosition.y;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3633 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3634 v660 = pParty->vPosition.y;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3635 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3636 pSpellSprite.vPosition.x = pParty->vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3637 pSpellSprite.vPosition.z = v51;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3638 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3639 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3640 pSpellSprite.uSectorID = v52;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3641 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3642 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3643 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3644 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3645 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3646 if ( pParty->bTurnBasedModeOn == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3647 LOBYTE(pSpellSprite.uAttributes) |= 4u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3648 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3649 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3650 ++pTurnEngine->field_1C;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3651 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3652 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3653 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3654 case SPELL_LIGHT_SUNRAY:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3655 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3656 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3657 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3658 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3659 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3660 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3661 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3662 continue;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3663 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3664 if ( pPlayer->CanCastSpell(uRequiredMana) )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3665 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3666 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3667 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3668 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3669 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3670 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3671 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3672 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3673 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3674 v660 = pParty->vPosition.y;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3675 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3676 pSpellSprite.vPosition.x = pParty->vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3677 pSpellSprite.vPosition.z = v51;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3678 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3679 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3680 pSpellSprite.uSectorID = v52;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3681 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3682 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3683 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3684 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3685 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3686 if ( pParty->bTurnBasedModeOn == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3687 LOBYTE(pSpellSprite.uAttributes) |= 4u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3688 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3689 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3690 ++pTurnEngine->field_1C;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3691 LODWORD(v727) = 1;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3692 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3693 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3694 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3695 case SPELL_LIGHT_PARALYZE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3696 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3697 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3698 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3699 if (PID_TYPE(a2) != OBJECT_Actor || (v730 = PID_ID(a2), v721 = (int)&pActors[PID_ID(a2)],
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3700 !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 9)) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3701 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3702 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3703 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3704 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3705 Actor::AI_Stand(PID_ID(a2), 4u, 0x80u, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3706 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3707 v55 = v721;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3708 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3709 *(char *)(v55 + 38) |= 8u;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3710 *(short *)(v55 + 148) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3711 v672 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3712 *(short *)(v55 + 150) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3713 v661 = (Actor *)v55;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3714 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3715 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3716 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3717 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3718 case SPELL_EARTH_SLOW:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3719 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3720 if ( v731 == 2 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3721 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3722 v57 = 300 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3723 amount = 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3724 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3725 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3726 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3727 amount = 4;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3728 v57 = 300 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3729 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3730 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3731 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3732 v57 = 300 * v2;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3733 amount = 8;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3734 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3735 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3736 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3737 v57 = 180 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3738 amount = 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3739 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3740 // LABEL_174:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3741 LODWORD(v733) = v57;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3742 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3743 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3744 if (PID_TYPE(a2) != OBJECT_Actor
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3745 || (v721 = 836 * PID_ID(a2),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3746 LODWORD(v718) = (int)&pActors[PID_ID(a2)],
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3747 !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 3u)) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3748 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3749 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3750 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3751 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3752 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3753 v59 = v721;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3754 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply(
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3755 pActors[PID_ID(a2)].pActorBuffs[7].Apply(pParty->uTimePlayed + (signed int)v58,
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3756 v731,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3757 amount,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3758 0,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3759 0);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3760 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3761 v672 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3762 v661 = (Actor *)LODWORD(v718);
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3763 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3764 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3765 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3766 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3767 case SPELL_MIND_CHARM:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3768 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3769 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3770 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3771
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3772 if ( !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3773 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3774 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3775 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3776 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3777
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3778 uint power = 300 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3779 if ( v731 == 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3780 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3781 power = 600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3782 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3783 else if ( v731 == 3 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3784 power = 29030400;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3785
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3786 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3787 pActors[PID_ID(a2)].pActorBuffs[9].Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3788 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3789 pActors[PID_ID(a2)].pActorBuffs[12].Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3790 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3791 pActors[PID_ID(a2)].pActorBuffs[1].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3792 v731, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3793 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3794 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3795 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3796 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3797 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3798 v61 = PID_ID(a2);
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3799 v600 = pActors[v61].vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3800 v601 = pActors[v61].vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3801 pSpellSprite.uObjectDescID = v60;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3802 pSpellSprite.vPosition.x = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3803 v602 = pActors[v61].uActorHeight;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3804 v603 = pActors[v61].vPosition.z;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3805 pSpellSprite.vPosition.y = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3806 v676 = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3807 v665 = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3808 pSpellSprite.vPosition.z = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3809 v657 = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3810 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3811 pSpellSprite.uSectorID = pIndoor->GetSector(v657, v665, v676);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3812 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3813 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3814 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3815 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3816 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3817 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3818 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3819 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3820 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3821 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3822 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3823 case SPELL_DARK_SHRINKING_RAY:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3824 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3825 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3826 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3827 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3828 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3829 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3830 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3831 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3832 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3833 pSpellSprite.uSectorID = pIndoor->GetSector(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3834 pParty->vPosition.x,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3835 pParty->vPosition.y,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3836 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3837 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3838 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3839 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3840 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3841 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3842 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3843 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3844 pSpellSprite.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3845 pSpellSprite.spell_level = 300 * v2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3846 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3847 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3848
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3849 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3850
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3851 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3852 ++pTurnEngine->field_1C;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3853 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3854 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3855 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3856 case SPELL_FIRE_FIRE_AURA:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3857 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3858 v63 = v731 - 1;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3859 if ( !v63 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3860 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3861 amount = 10;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3862 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3863 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3864 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3865 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3866 v64 = v63 - 1;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3867 if ( !v64 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3868 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3869 amount = 11;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3870 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3871 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3872 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3873 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3874 v65 = v64 - 1;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3875 if ( !v65 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3876 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3877 amount = 12;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3878 // LABEL_195:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3879 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3880 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3881 else if ( v65 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3882 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3883 LODWORD(v733) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3884 amount = 12;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3885 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3886 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3887 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3888 // LABEL_196:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3889 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3890 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3891 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItems[a2];
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3892 auto _itm = &pItemsTable->pItems[v730c->uItemID];
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3893 v730c->UpdateTempBonus(pParty->uTimePlayed);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3894 if ( v730c->uItemID < 64 || v730c->uItemID > 65
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3895 && !v730c->Broken()
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3896 && !v730c->uSpecEnchantmentType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3897 && !v730c->uEnchantmentType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3898 && ( _itm->uEquipType == 0 || _itm->uEquipType == 1 || _itm->uEquipType == 2)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3899 && !pItemsTable->IsMaterialNonCommon(v730c) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3900 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3901 v69 = v730c;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3902 v14 = v731 == 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3903 v730c->uSpecEnchantmentType = amount;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3904 if ( !v14 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3905 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3906 v69->uExpireTime = pParty->uTimePlayed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3907 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3908 * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3909 v69->uAttributes |= 8u;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3910 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3911 v69->uAttributes |= 0x10u;
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 961
diff changeset
3912 _50C9A8_item_enchantment_timer = 256;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3913 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3914 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3915 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3916
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3917 dword_50C9D0 = 113;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3918 dword_50C9D4 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3919 dword_50C9D8 = 1;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3920
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3921 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3922 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3923 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3924 continue;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3925 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3926 case SPELL_BODY_REGENERATION:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3927 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3928 v70 = v731 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3929 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3930 if ( v70 && (v71 = v70 - 1) != 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3931 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3932 v72 = v71 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3933 if ( v72 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3934 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3935 if ( v72 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3936 amount = 10;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3937 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3938 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
3939 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3940 amount = 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3941 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3942 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3943 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3944 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3945 amount = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3946 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3947 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3948 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3949
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3950 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3951
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3952 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3953 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
3954 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3955 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3956 case SPELL_FIRE_PROTECTION_FROM_FIRE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3957 case SPELL_AIR_PROTECTION_FROM_AIR:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3958 case SPELL_WATER_PROTECTION_FROM_WATER:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3959 case SPELL_EARTH_PROTECTION_FROM_EARTH:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3960 case SPELL_MIND_PROTECTION_FROM_MIND:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3961 case SPELL_BODY_PROTECTION_FROM_BODY:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3962 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3963 LODWORD(v733) = 3600 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3964 if ( v731 > 0 && v731 <= 4)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3965 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3966 amount = v731 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3967 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
3968 //LABEL_232:
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3969 //v80 = v3->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3970 switch (pCastSpell->spellnum)
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3971 {
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3972 case SPELL_FIRE_PROTECTION_FROM_FIRE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3973 LODWORD(v725) = PARTY_BUFF_RESIST_FIRE;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3974 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3975 case SPELL_AIR_PROTECTION_FROM_AIR:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3976 LODWORD(v725) = PARTY_BUFF_RESIST_AIR;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3977 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3978 case SPELL_WATER_PROTECTION_FROM_WATER:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3979 LODWORD(v725) = PARTY_BUFF_RESIST_WATER;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3980 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3981 case SPELL_EARTH_PROTECTION_FROM_EARTH:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3982 LODWORD(v725) = PARTY_BUFF_RESIST_EARTH;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3983 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3984 case SPELL_MIND_PROTECTION_FROM_MIND:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3985 LODWORD(v725) = PARTY_BUFF_RESIST_MIND;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3986 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3987 case SPELL_BODY_PROTECTION_FROM_BODY:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3988 LODWORD(v725) = PARTY_BUFF_RESIST_BODY;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3989 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3990 default:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3991 assert(false);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3992 continue;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3993 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3994 if ( !pPlayer->CanCastSpell(uRequiredMana) )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3995 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3996 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3997 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3998 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
3999 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4000 v90 = (double)(signed int)v733 * 4.2666669;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4001 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4002 LODWORD(v727) = 1;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4003 break;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4004 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4005 case SPELL_FIRE_HASTE:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4006 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4007 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4008 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4009 LODWORD(v733) = 60 * (v2 + 60);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4010 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4011 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4012 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4013 LODWORD(v733) = 180 * (v2 + 20);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4014 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4015 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4016 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4017 LODWORD(v733) = 240 * (v2 + 15);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4018 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4019 if ( pPlayer->CanCastSpell(uRequiredMana) )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4020 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4021 v92 = pParty->pPlayers;//[0].pConditions[1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4022 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4023 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4024 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4025 if ( v92->pConditions )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4026 LODWORD(v727) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4027 ++v92;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4028 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4029 while ( v92 <= &pParty->pPlayers[3] );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4030 if (LODWORD(v727))
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4031 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4032 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4033
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4034 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4035 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4036 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4037 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4038 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4039 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4040 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4041 }
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4042 case SPELL_SPIRIT_BLESS:
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4043 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4044 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4045 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4046 LODWORD(v733) = 300 * (v2 + 12);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4047 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4048 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4049 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4050 LODWORD(v733) = 900 * (v2 + 4);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4051 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4052 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4053 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4054 LODWORD(v733) = 3600 * (v2 + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4055 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4056 // LABEL_269:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4057 amount = v2 + 5;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4058 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4059 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4060 if ( v731 == 1 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4061 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4062 v108 = pCastSpell->uPlayerID_2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4063 v109 = pCastSpell->spellnum;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4064 v110 = pGame->GetStru6();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4065 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4066 v111 = pOtherOverlayList->_4418B1(10000, pCastSpell->uPlayerID_2 + 310, 0, 65536);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4067 //v668 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4068 v716 = v111;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4069 //v658 = v111;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4070 //v653 = amount;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4071 //v651 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4072 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4073 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS];
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4074 //LABEL_103:
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4075 //HIDWORD(v650) = HIDWORD(v28);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4076 //LABEL_104:
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4077 //LODWORD(v650) = v28;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4078 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 1, amount, v111, 0);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4079 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4080 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4081 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4082 v105 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4083 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4084 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1];
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4085 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4086 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4087 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v105);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4088 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4089 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4090 ++v730b;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4091 ++v105;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4092 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4093 while ( v730b <= &pParty->pPlayers[3] );
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4094 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4095 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4096 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4097 case SPELL_SPIRIT_SPIRIT_LASH:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4098 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4099 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && PID_TYPE(a2) == OBJECT_Actor)
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4100 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4101 //v730 = a2 >> 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4102 v112 = &pActors[PID_ID(a2)];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4103 //v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4104 v721 = abs(v112->vPosition.y - pParty->vPosition.y);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4105 v113 = abs(v112->vPosition.x - pParty->vPosition.x);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4106 _this = (ItemGen *)v113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4107 v114 = v721;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4108 v115 = (unsigned int)abs(v112->vPosition.z - pParty->vPosition.z);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4109 if ( v113 < v721 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4110 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4111 v116 = v113;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4112 v113 = v721;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4113 v114 = v116;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4114 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4115 if ( v113 < (signed int)v115 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4116 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4117 v117 = v113;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4118 v113 = (int)v115;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4119 v115 = v117;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4120 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4121 if ( v114 < (signed int)v115 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4122 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4123 v118 = v115;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4124 v115 = v114;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4125 v114 = v118;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4126 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4127 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4128 if ( (double)(signed int)this <= 307.2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4129 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4130 v701.x = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4131 v701.y = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4132 v701.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4133 pSpellSprite.stru_24.Reset();
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4134 v119 = HIDWORD(v733);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4135 pSpellSprite.spell_id = *(int *)HIDWORD(v733);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4136 pSpellSprite.spell_level = v723;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4137 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4138 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4139 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4140 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4141 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4142 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4143 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, *(short *)(v119 + 2));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4144 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4145 pSpellSprite.uSoundID = *(short *)(v119 + 16);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4146 pSpellSprite.vPosition.x = v112->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4147 pSpellSprite.vPosition.y = v112->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4148 pSpellSprite.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v112->uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4149 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, a2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4150 v122 = pSpellSprite.Create(0, 0, 0, 0);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4151 DamageMonsterFromParty(PID(OBJECT_Item, v122), PID_ID(a2), &v701);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4152 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4153 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4154 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4155 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4156 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4157 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4158 *(int *)HIDWORD(v733) = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4159 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4160 pCastSpell = (CastSpellInfo *)HIDWORD(v733);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4161 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4162 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4163 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4164 case SPELL_AIR_SHIELD:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4165 case SPELL_EARTH_STONESKIN:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4166 case SPELL_SPIRIT_HEROISM:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4167 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4168 if( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4169 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4170 LODWORD(v733) = 300 * (v2 + 12);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4171 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4172 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4173 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4174 LODWORD(v733) = 900 * (v2 + 4);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4175 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4176 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4177 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4178 LODWORD(v733) = 3600 * (v2 + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4179 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4180
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4181 // LABEL_296:
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4182 v127 = pCastSpell->spellnum;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4183 if ( v127 == 17 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4184 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4185 amount = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4186 LODWORD(v725) = 14;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4187 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4188 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4189 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4190 if ( v127 == 38 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4191 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4192 LODWORD(v725) = 15;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4193 amount = v2 + 5;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4194 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4195 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4196 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4197 if ( v127 != 51 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4198 continue;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4199 LODWORD(v725) = 9;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4200 amount = v2 + 5;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4201 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4202 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4203 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4204 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4205 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4206 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4207 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4208 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4209 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4210 //LABEL_304:
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4211 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4212 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4213 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4214 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4215 case SPELL_FIRE_IMMOLATION:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4216 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4217 if ( v731 == 4 && v139 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4218 LODWORD(v733) = 600 * v2;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4219 else
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4220 LODWORD(v733) = 60 * v2;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4221 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4222 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4223
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4224 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4225 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4226 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4227 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4228
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4229 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4230 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4231 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4232 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4233 case SPELL_FIRE_METEOR_SHOWER:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4234 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4235 v149 = v731 - 1;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4236 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4237 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4238 if ( v151 == 1 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4239 _this = (ItemGen *)20;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4240 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4241 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4242 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4243 _this = (ItemGen *)16;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4244 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4245 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4246 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4247 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4248 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4249 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4250 continue;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4251 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4252 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4253 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4254 LODWORD(v725) = PID_TYPE(a2);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4255 if (PID_TYPE(a2) == OBJECT_Actor)
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4256 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4257 uRequiredMana = pActors[PID_ID(a2)].vPosition.x;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4258 v153 = pActors[PID_ID(a2)].vPosition.y;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4259 v154 = pActors[PID_ID(a2)].vPosition.z;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4260 LODWORD(v727) = v153;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4261 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4262 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4263 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4264 v155 = stru_5C6E00->Cos(pParty->sRotationY);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4265 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4266 v156 = stru_5C6E00->Sin(pParty->sRotationY);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4267 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4268 v154 = pParty->vPosition.z;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4269 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4270 HIDWORD(v733) = v154;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4271 v713 = v154 + 2500;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4272 v721 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4273 LODWORD(v718) = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4274 if ( (signed int)_this > 0 )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4275 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4276 *(float *)&y = (double)SHIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4277 *(float *)&v732 = (double)v713;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4278 v730 = LODWORD(v725) == 3 ? a2 : 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4279 auto _this_cpy = (int)_this;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4280 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4281 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4282 //v157 = rand();
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4283 v158 = (double)SLODWORD(v718);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4284 v718 = v158;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4285 v159 = (double)v721;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4286 *(float *)&v721 = v159;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4287 a2 = rand() % 1000;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4288 *((float *)&v733 + 1) = (double)(rand() % 1000) + *(float *)&y - *(float *)&v732;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4289 //v725 = v159 * v159;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4290 *(float *)&_this = v158 * v158;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4291 //if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4292 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v159 * v159) <= 1.0 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4293 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4294 LODWORD(v687) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4295 HIDWORD(v687) = 0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4296 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4297 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4298 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4299 //x = (signed __int64)sqrt(*(float *)&_this + v725);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4300 x = (signed __int64)sqrt(*(float *)&_this + v159 * v159);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4301 v687 = __PAIR__(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4302 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4303 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721));
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4304 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4305 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4306 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4307 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4308 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4309 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4310 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4311 pSpellSprite.vPosition.x = uRequiredMana;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4312 pSpellSprite.vPosition.y = LODWORD(v727);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4313 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4314 pSpellSprite.vPosition.z = a2 + v713;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4315 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4316 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4317 pSpellSprite.spell_target_pid = v730;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4318 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4319 pSpellSprite.uFacing = v687;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4320 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4321 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4322 pSpellSprite.uAttributes = 4;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4323 if ( pSpellSprite.Create(v687, SHIDWORD(v687), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4324 && pParty->bTurnBasedModeOn == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4325 ++pTurnEngine->field_1C;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4326 LODWORD(v718) = rand() % 1024 - 512;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4327 //v160 = rand();
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4328 v14 = _this_cpy-- == 1;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4329 v721 = (unsigned __int64)(rand() % 1024) - 512;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4330 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4331 while ( !v14 );
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4332 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4333 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4334 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4335 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4336 case SPELL_FIRE_INFERNO:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4337 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4338 //v67 = 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4339 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4340 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4341 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4342 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4343 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4344 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4345 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4346 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4347 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4348 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4349 v700.z = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4350 v700.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4351 v700.x = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4352 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4353 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4354 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4355 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4356 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4357 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4358 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4359 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4360 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4361 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4362 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4363 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4364 a2 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4365 if ( (signed int)_v726 > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4366 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4367 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4368 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4369 v162 = dword_50BF30[a2];
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4370 pSpellSprite.vPosition.x = pActors[v162].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4371 pSpellSprite.vPosition.y = pActors[v162].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4372 pSpellSprite.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v162].uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4373 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4374 v164 = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4375 v165 = a2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4376 DamageMonsterFromParty(PID(OBJECT_Item, v164), dword_50BF30[a2], &v700);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4377 pGame->GetStru6()->_4A81CA(&pSpellSprite);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4378 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4379 a2 = v165 + 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4380 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4381 while ( v165 + 1 < (signed int)_v726 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4382 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4383 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4384 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4385 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4386
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4387 case SPELL_AIR_WIZARD_EYE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4388 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4389 LODWORD(v733) = 3600 * v2;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4390 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4391 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4392 v168 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4393 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4394 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4395 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4396 v716 = v169;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4397 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4398 while ( v168 < 4 );
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4399
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4400 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4401 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4402 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4403 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4404 case SPELL_AIR_FEATHER_FALL:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4405 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4406 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4407 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4408 LODWORD(v733) = 300 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4409 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4410 else if ( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4411 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4412 LODWORD(v733) = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4413 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4414 else if ( v731 == 3 || v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4415 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4416 LODWORD(v733) = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4417 //LABEL_353:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4418 //LODWORD(v733) = v173;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4419 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4420 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4421 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4422 v174 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4423 do
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4424 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4425 while ( v174 < 4 );
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4426 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4427 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4428 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4429 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4430
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4431 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4432 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4433 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4434 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4435 case SPELL_AIR_SPARKS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4436 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4437 v184 = v731 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4438 if ( v184 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4439 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4440 v185 = v184 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4441 if ( v185 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4442 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4443 v186 = v185 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4444 if ( v186 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4445 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4446 if ( v186 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4447 amount = 9;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4448 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4449 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4450 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4451 amount = 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4452 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4453 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4454 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4455 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4456 amount = 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4457 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4458 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4459 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4460 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4461 amount = 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4462 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4463 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4464 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4465 auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4466 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4467 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4468 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4469 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4470 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4471 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4472 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4473 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4474 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4475 pSpellSprite.uSectorID = pIndoor->GetSector(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4476 pParty->vPosition.x,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4477 pParty->vPosition.y,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4478 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4479 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4480 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4481 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4482 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4483 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4484 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4485 LOBYTE(pSpellSprite.uAttributes) |= 4u;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4486 v188 = (signed int)_v726 / -2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4487 v189 = (signed int)_v726 / 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4488 while ( v188 <= v189 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4489 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4490 pSpellSprite.uFacing = v188 + LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4491 if ( pSpellSprite.Create(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4492 (signed __int16)(v188 + LOWORD(v715.uYawAngle)),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4493 v715.uPitchAngle,
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4494 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4495 pCastSpell->uPlayerID + 1) != -1
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4496 && pParty->bTurnBasedModeOn == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4497 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4498 v188 += _v726 / (amount - 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4499 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4500 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4501 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4502 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4503
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4504 case SPELL_AIR_JUMP:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4505 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4506 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4507 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4508 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4509 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4510 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4511 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4512 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4513 break;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4514 v191 = 0;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4515 do
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4516 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4517 while ( v191 < 4 );
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4518 BYTE1(pParty->uFlags) |= 1u;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4519 pParty->uFallSpeed = 1000;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4520 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4521 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4522 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4523 case SPELL_AIR_INVISIBILITY:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4524 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4525 v192 = v731 - 1;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4526 if ( v731 == 1 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4527 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4528 amount = v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4529 LODWORD(v733) = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4530 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4531 else if ( v731 == 2 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4532 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4533 v196 = 2 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4534 amount = v196;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4535 LODWORD(v733) = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4536 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4537 else if ( v731 == 3 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4538 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4539 v196 = 3 * v2;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4540 //goto LABEL_389;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4541 amount = v196;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4542 LODWORD(v733) = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4543 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4544 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4545 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4546 amount = 4 * v2;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4547 v195 = 3600 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4548 // LABEL_392:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4549 LODWORD(v733) = v195;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4550 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4551 // LABEL_393:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4552 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW))
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4553 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4554 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4555 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4556 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4557 continue;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4558 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4559 if ( pPlayer->CanCastSpell(uRequiredMana) )
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4560 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4561 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4562 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4563 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4564 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4565
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4566 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4567 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4568 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4569 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4570 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4571 case SPELL_AIR_FLY:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4572 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4573 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4574 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4575 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4576 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4577 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4578 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4579 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4580 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4581 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4582 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4583 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4584 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4585 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4586 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4587 amount = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4588 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4589 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4590 v205 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4591 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4592 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4593 while ( v205 < 4 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4594 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4595 v207 = pCastSpell->uPlayerID + 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4596 v716 = v206;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4597
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4598 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4599 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4600 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4601 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4602
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4603 case SPELL_AIR_STARBURST:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4604 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4605 //v67 = 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4606 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4607 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4608 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4609 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4610 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4611 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4612 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4613 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4614 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4615 v208 = PID_TYPE(a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4616 LODWORD(v725) = PID_TYPE(a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4617 if ( v208 == 3 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4618 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4619 v209 = PID_ID(a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4620 LODWORD(v718) = pActors[v209].vPosition.x;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4621 v210 = pActors[v209].vPosition.y;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4622 v211 = pActors[v209].vPosition.z;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4623 v713 = v210;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4624 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4625 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4626 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4627 v212 = stru_5C6E00->Cos(pParty->sRotationY);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4628 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4629 v213 = stru_5C6E00->Sin(pParty->sRotationY);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4630 v214 = sub_42EBBE(2048, v213);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4631 v211 = pParty->vPosition.z;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4632 v713 = pParty->vPosition.y + v214;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4633 v208 = LODWORD(v725);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4634 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4635 HIDWORD(v733) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4636 *(float *)&v732 = (double)v211;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4637 LODWORD(v725) = v211 + 2500;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4638 v721 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4639 *(float *)&y = (double)(v211 + 2500);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4640 v730 = v208 == 3 ? a2 : 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4641 a2 = 20;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4642 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4643 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4644 v215 = rand();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4645 v216 = (double)v721;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4646 v217 = (double)SHIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4647 *(float *)&uRequiredMana = v217;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4648 _this = (ItemGen *)(v215 % 1000);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4649 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4650 *(float *)&v721 = v217 * v217;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4651 //*(float *)&v726 = v216 * v216;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4652 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + v216 * v216 + *(float *)&v721) <= 1.0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4653 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4654 LODWORD(v685) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4655 HIDWORD(v685) = 0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4656 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4657 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4658 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4659 v684 = (signed __int64)sqrt(v216 * v216 + *(float *)&v721);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4660 v685 = __PAIR__(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4661 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4662 stru_5C6E00->Atan2((signed __int64)v216, (signed __int64)*(float *)&uRequiredMana));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4663 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4664 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4665 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4666 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4667 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4668 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4669 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4670 pSpellSprite.vPosition.x = LODWORD(v718);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4671 pSpellSprite.vPosition.y = v713;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4672 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4673 pSpellSprite.vPosition.z = (int)((char *)_this + LODWORD(v725));
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4674 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4675 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4676 pSpellSprite.spell_target_pid = v730;
921
3696848c0413 meteorite rain and other spells fix
Ritor1
parents: 907
diff changeset
4677 //__debugbreak();//çâåçäîïàä
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4678 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4679 pSpellSprite.uFacing = v685;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4680 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4681 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4682 pSpellSprite.uAttributes = 4;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4683 if ( pSpellSprite.Create(v685, SHIDWORD(v685), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4684 && pParty->bTurnBasedModeOn == 1 )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4685 ++pTurnEngine->field_1C;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4686 v721 = rand() % 1024 - 512;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4687 v218 = rand();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4688 v14 = a2-- == 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4689 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4690 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4691 while ( !v14 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4692 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4693 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4694 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4695
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4696 case SPELL_WATER_AWAKEN:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4697 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4698 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4699 amount = 180 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4700 else if ( v731 == 2)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4701 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4702 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4703 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4704 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4705 amount = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4706 // LABEL_433:
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4707 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4708 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4709 v222 = pParty->pPlayers;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4710 HIDWORD(v733) = (int)(char *)&pParty + 2508;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4711 while ( 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4712 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4713 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4714 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4715 if ( v222->pConditions[2] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4716 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4717 //*((int *)v222 + 4) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4718 //*((int *)v222 + 5) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4719 v222->pConditions[2] = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4720 v222->PlaySound(SPEECH_103, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4721 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4722 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4723 else
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4724 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4725 v223 = v222->DiscardConditionIfLastsLongerThan(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4726 2u,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4727 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4728 v222 = (Player *)HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4729 if ( v223 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4730 v222->PlaySound(SPEECH_103, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4731 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4732 ++v222;// += 6972;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4733 HIDWORD(v733) = (int)v222;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4734 if ( v222 >= &pParty->pPlayers[3] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4735 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4736 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4737 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4738 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4739 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4740 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4741 case SPELL_WATER_POISON_SPRAY:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4742 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4743 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4744 amount = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4745 else if ( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4746 amount = 3;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4747 else if ( v731 == 3 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4748 amount = 5;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4749 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4750 amount = 7;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4751 if ( !pPlayer->CanCastSpell(uRequiredMana) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4752 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4753 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4754 if ( amount == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4755 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4756 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4757 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4758 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4759 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4760 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4761 pSpellSprite.vPosition.y = pParty->vPosition.y;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4762 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4763 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4764 v660 = pParty->vPosition.y;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4765 // LABEL_153:
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4766 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4767 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4768 pSpellSprite.vPosition.z = v51;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4769 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4770 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4771 pSpellSprite.uSectorID = v52;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4772 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4773 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4774 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4775 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4776 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4777 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4778 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4779 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4780 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4781 ++pTurnEngine->field_1C;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4782 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4783 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4784 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4785 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4786 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4787 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4788 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4789 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4790 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4791 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4792 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4793 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4794 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4795 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4796 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4797 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4798 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4799 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4800 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4801 LOBYTE(pSpellSprite.uAttributes) |= 4u;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4802 v227 = SHIDWORD(v733) / -2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4803 y = (char *)(SHIDWORD(v733) / 2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4804 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4805 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4806 v228 = v715.uYawAngle;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4807 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4808 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4809 pSpellSprite.uFacing = v227 + v228;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4810 if ( pSpellSprite.Create(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4811 v227 + v228,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4812 v715.uPitchAngle,
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4813 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4814 pCastSpell->uPlayerID + 1) != -1
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4815 && pParty->bTurnBasedModeOn == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4816 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4817 v227 += SHIDWORD(v733) / (amount - 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4818 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4819 while ( v227 <= (signed int)y );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4820 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4821 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4822 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4823 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4824 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4825 case SPELL_WATER_WATER_WALK:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4826 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4827 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4828 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4829 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4830 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4831 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4832 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4833 if ( v731 == 2 || v731 != 3 && v731 != 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4834 v229 = 600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4835 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4836 v229 = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4837 LODWORD(v733) = v229;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4838 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4839 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4840 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4841 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4842 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4843 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4844 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4845
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4846 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4847 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4848 v731,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4849 amount,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4850 v716,
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4851 pCastSpell->uPlayerID + 1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4852 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4853 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4854 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4855 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4856 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4857 case SPELL_WATER_RECHARGE_ITEM:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4858 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4859 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4860 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4861 v240 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItems[a2];
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4862 y = v240;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4863 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4864 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4865 dword_50C9D0 = 113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4866 dword_50C9D4 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4867 dword_50C9D8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4868
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4869 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4870 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4871 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4872 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4873 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4874 if ( v731 == 1 || v731 == 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4875 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4876 v241 = (double)v723 * 0.0099999998 + 0.5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4877 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4878 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4879 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4880 v241 = (double)v723 * 0.0099999998 + 0.69999999;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4881 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4882 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4883 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4884 v241 = (double)v723 * 0.0099999998 + 0.80000001;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4885 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4886 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4887 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4888 v241 = 0.0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4889 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4890 if ( v241 > 1.0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4891 v241 = 1.0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4892 //LABEL_484:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4893 v732 = (unsigned __int8)v240[25];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4894 v242 = (signed __int64)((double)v732 * v241);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4895 v243 = y;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4896 y[25] = v242;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4897 *((int *)v243 + 4) = (unsigned __int8)v242;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4898 if ( (unsigned __int8)v242 <= 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4899 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4900 *(int *)v243 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4901 dword_50C9D0 = 113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4902 dword_50C9D4 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4903 dword_50C9D8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4904 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4905 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4906 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4907 v2 = v723;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4908 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4909 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4910 *((int *)v243 + 5) |= 0x40u;
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 961
diff changeset
4911 _50C9A8_item_enchantment_timer = 256;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4912 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4913 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4914 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4915 case SPELL_WATER_ENCHANT_ITEM:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4916 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4917 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4918 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4919 uRequiredMana = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4920 HIDWORD(v733) = 10 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4921 v730 = 1;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
4922 v244 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2];
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4923 if ( v731 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4924 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4925 v245 = (int)&v244[36 * a2 + 532];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4926 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4927 v311 = __OFSUB__(*(int *)v245, 134);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4928 v14 = *(int *)v245 == 134;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4929 v310 = *(int *)v245 - 134 < 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4930 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4931 if ( (unsigned __int8)(v310 ^ v311) | v14 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4932 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4933 if ( *(int *)&v244[36 * a2 + 544] == 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4934 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4935 if ( *(int *)&v244[36 * a2 + 536] == 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4936 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4937 if ( *(int *)&v244[36 * a2 + 540] == 0 )
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
4938 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4939 v312 = v309[28];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4940 if ( v312 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4941 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4942 if ( v312 != 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4943 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4944 if ( v312 != 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4945 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4946 _this = (ItemGen *)&v244[36 * a2 + 552];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4947 if ( !(v244[36 * a2 + 552] & 2) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4948 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4949 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4950 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4951 uRequiredMana = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4952 v730 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4953 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4954 if ( rand() % 100 >= SHIDWORD(v733) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4955 uRequiredMana = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4956 if (!uRequiredMana)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4957 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4958 v313 = *(char *)(LODWORD(v725) + 28);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4959 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4960 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4961 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4962 *(int *)(v245 + 4) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4963 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4964 + 1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4965 ;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4966 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4967 + 1] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4968 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4969 ++*(int *)(v245 + 4);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4970 if ( j >= v314 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4971 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4972 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4973 v254 = rand();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4974 v255 = 10;//pItemsTable->field_116D8[17];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4975 v256 = 10;//pItemsTable->field_116D8[16];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4976 //LABEL_611:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4977 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1);
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4978 //LABEL_612:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4979 _this->uItemID |= 0x20u;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4980
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 961
diff changeset
4981 _50C9A8_item_enchantment_timer = 256;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4982 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4983 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4984 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4985 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4986 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4987 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4988 //LABEL_613:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4989 v316 = _this->uItemID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4990 if ( !(BYTE1(v316) & 2) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4991 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4992 LOBYTE(v316) = v316 | 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4993 _this->uItemID = v316;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4994 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
4995 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4996 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4997 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4998 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
4999 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5000 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5001 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5002 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5003 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5004 //LABEL_616:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5005 if ( LODWORD(v727) == 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5006 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5007 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5008 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5009 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5010 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5011 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5012 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5013 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5014 v318->PlaySound(SPEECH_43, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5015 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5016 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5017 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5018 if ( v731 != 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5019 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5020 if ( v731 == 3 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5021 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5022 v245 = (int)&v244[36 * a2 + 532];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5023 v269 = *(int *)v245;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5024 if ( *(int *)v245 > 134
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5025 || *(int *)(v245 + 12) != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5026 || *(int *)(v245 + 4) != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5027 || *(int *)(v245 + 8) != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5028 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5029 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5030 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5031 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5032 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5033 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5034 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5035 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5036 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5037 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5038 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5039 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5040 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5041 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5042 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5043 v270 = (char *)&pItemsTable->pItems[v269].pIconName;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5044 LODWORD(v725) = (int)v270;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5045 v271 = v270[28];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5046 if ( v271 && v271 != 1 && v271 != 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5047 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5048 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5049 v272 = ((ItemGen *)v245)->GetValue() < 0xFA;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5050 if ( v272 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5051 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5052 uRequiredMana = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5053 v730 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5054 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5055 if ( rand() % 100 >= SHIDWORD(v733) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5056 uRequiredMana = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5057 if (uRequiredMana)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5058 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5059 v316 = _this->uItemID;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5060 if ( !(BYTE1(v316) & 2) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5061 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5062 LOBYTE(v316) = v316 | 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5063 _this->uItemID = v316;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5064 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5065 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5066 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5067 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5068 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5069 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5070 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5071 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5072 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5073 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5074 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5075 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5076 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5077 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5078 //v273 = v725;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5079 v274 = *(char *)(LODWORD(v725) + 28);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5080 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 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5081 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5082 if ( rand() % 100 < 80
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5083 //&& !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5084 && !(*(char *)(LODWORD(v725) + 28) == 0 | *(char *)(LODWORD(v725) + 28) == 1 | *(char *)(LODWORD(v725) + 28) == 2) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5085 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5086 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5087 *(int *)(v245 + 4) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5088 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5089 ;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5090 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5091 + 1] )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5092 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5093 ++*(int *)(v245 + 4);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5094 if ( k >= v275 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5095 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5096 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5097 v254 = rand();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5098 v255 = 10;//pItemsTable->field_116D8[19];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5099 v256 = 10;//pItemsTable->field_116D8[18];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5100 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5101 _this->uItemID |= 0x20u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5102
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5103 _50C9A8_item_enchantment_timer = 256;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5104 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5105 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5106 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5107 v277 = pItemsTable->pSpecialEnchantments_count;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5108 v278 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5109 v725 = 0.0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5110 HIDWORD(v733) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5111 if ( pItemsTable->pSpecialEnchantments_count > 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5112 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5113 v730 = (int)&v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5114 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5115 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5116 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5117 if ( !v279 || v279 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5118 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5119 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5120 + 4]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5121 + v278 * 28);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5122 LODWORD(v725) += v280;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5123 if ( v280 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5124 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5125 v281 = v730;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5126 v730 += 4;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5127 *(int *)v281 = HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5128 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5129 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5130 ++HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5131 ++v278;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5132 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5133 while ( SHIDWORD(v733) < v277 );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5134 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5135 v282 = rand() % SLODWORD(v725);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5136 v283 = v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5137 *(int *)(v245 + 12) = v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5138 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5139 v285 = v282 + 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5140 if ( v284 < v285 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5141 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5142 for ( l = &v679; ; l = (int *)v732 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5143 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5144 v287 = (int)(l + 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5145 v732 = v287;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5146 v288 = *(int *)v287;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5147 *(int *)(v245 + 12) = v288;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5148 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5149 + 4];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5150 if ( v284 >= v285 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5151 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5152 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5153 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5154 ++*(int *)(v245 + 12);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5155 _this->uItemID |= 0x20u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5156
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5157 _50C9A8_item_enchantment_timer = 256;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5158 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5159 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5160 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5161 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5162 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5163 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5164 __debugbreak(); // v726 is most probably the caster, filled in case 54
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5165 if ( v731 != 4
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5166 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5167 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5168 || v726->pInventoryItems[a2].uEnchantmentType != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5169 || v726->pInventoryItems[a2]._bonus_strength != 0
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5170 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5171 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5172 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5173 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5174 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5175 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5176 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5177 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5178 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5179 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5180 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5181 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5182 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5183 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5184 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5185 v247 = (char *)&pItemsTable->pItems[v246].pIconName;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5186 LODWORD(v725) = (int)v247;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5187 v248 = v247[28];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5188 if ( v248 && v248 != 1 && v248 != 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5189 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5190 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5191 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5192 if ( v249 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5193 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5194 uRequiredMana = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5195 v730 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5196 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5197 if ( rand() % 100 >= SHIDWORD(v733) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5198 uRequiredMana = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5199 if (uRequiredMana)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5200 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5201 v316 = _this->uItemID;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5202 if ( !(BYTE1(v316) & 2) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5203 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5204 LOBYTE(v316) = v316 | 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5205 _this->uItemID = v316;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5206 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5207 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5208 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5209 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5210 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5211 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5212 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5213 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5214 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5215 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5216 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5217 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5218 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5219 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5220 v250 = v725;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5221 v251 = *(char *)(LODWORD(v725) + 28);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5222 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 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5223 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5224 if ( rand() % 100 < 80
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5225 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5226 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5227 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5228 *(int *)(v245 + 4) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5229 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5230 ;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5231 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5232 + 1] )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5233 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5234 ++*(int *)(v245 + 4);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5235 if ( m >= v252 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5236 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5237 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5238 v254 = rand();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5239 v255 = 10;// pItemsTable->field_116D8[21];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5240 v256 = 10;//pItemsTable->field_116D8[20];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5241 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5242 _this->uItemID |= 0x20u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5243
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5244 _50C9A8_item_enchantment_timer = 256;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5245 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5246 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5247 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5248 v257 = pItemsTable->pSpecialEnchantments_count;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5249 v258 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5250 v725 = 0.0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5251 HIDWORD(v733) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5252 if ( pItemsTable->pSpecialEnchantments_count > 0 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5253 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5254 v730 = (int)&v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5255 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5256 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5257 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5258 if ( !v259 || v259 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5259 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5260 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5261 + 4]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5262 + v258 * 28);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5263 LODWORD(v725) += v260;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5264 if ( v260 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5265 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5266 v261 = v730;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5267 v730 += 4;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5268 *(int *)v261 = HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5269 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5270 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5271 ++HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5272 ++v258;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5273 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5274 while ( SHIDWORD(v733) < v257 );
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5275 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5276 v262 = rand() % SLODWORD(v725);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5277 v263 = v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5278 *(int *)(v245 + 12) = v679;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5279 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5280 v265 = v262 + 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5281 if ( v264 < v265 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5282 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5283 for ( ii = &v679; ; ii = (int *)v732 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5284 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5285 v267 = (int)(ii + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5286 v732 = v267;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5287 v268 = *(int *)v267;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5288 *(int *)(v245 + 12) = v268;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5289 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5290 + 4];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5291 if ( v264 >= v265 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5292 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5293 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5294 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5295 ++*(int *)(v245 + 12);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5296 _this->uItemID |= 0x20u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5297
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5298 _50C9A8_item_enchantment_timer = 256;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5299 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5300 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5301 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5302 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5303 //v1 = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5304 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5305 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5306 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5307 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5308 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5309 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5310 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5311 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5312 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5313 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5314 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5315 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5316 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5317 v289 = (ItemGen *)&v244[36 * a2 + 532];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5318 _this = v289;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5319 v290 = v289->uItemID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5320 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5321 if ( v290 > 134
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5322 || _this->uSpecEnchantmentType != 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5323 || _this->uEnchantmentType != 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5324 || _this->_bonus_strength != 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5325 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5326 || v291 == 1
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5327 || v291 == 2
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5328 || _this->Broken())
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5329 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5330 if ( LODWORD(v727) == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5331 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5332 v317 = pGlobalTXT_LocalizationStrings[428];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5333 if ( v730 == 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5334 v317 = pGlobalTXT_LocalizationStrings[585];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5335 ShowStatusBarString(v317, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5336 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5337 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5338 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5339 v318->PlaySound(SPEECH_43, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5340 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5341 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5342 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5343 if ( _this->GetValue() < 0x1C2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5344 uRequiredMana = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5345 if ( rand() % 100 >= SHIDWORD(v733) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5346 uRequiredMana = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5347 if ( uRequiredMana != 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5348 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5349 dword_50C9D0 = 113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5350 dword_50C9D4 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5351 dword_50C9D8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5352
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5353 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5354 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5355 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5356 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5357 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5358 v292 = *(char *)(LODWORD(v725) + 28);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5359 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5360 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5361 v2 = v723;
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5362 //v1 = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5363
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5364 dword_50C9D0 = 113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5365 dword_50C9D4 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5366 dword_50C9D8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5367
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5368 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5369 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5370 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5371 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5372 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5373 if ( rand() % 100 >= 80 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5374 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5375 v297 = pItemsTable->pSpecialEnchantments_count;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5376 v294 = _this;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5377 v298 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5378 v725 = 0.0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5379 HIDWORD(v733) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5380 if ( pItemsTable->pSpecialEnchantments_count > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5381 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5382 v730 = (int)&v679;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5383 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5384 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5385 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5386 if ( !v299 || v299 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5387 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5388 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5389 + v298 * 28);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5390 LODWORD(v725) += v300;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5391 if ( v300 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5392 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5393 v301 = v730;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5394 v730 += 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5395 *(int *)v301 = HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5396 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5397 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5398 ++HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5399 ++v298;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5400 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5401 while ( SHIDWORD(v733) < v297 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5402 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5403 v302 = rand() % SLODWORD(v725);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5404 v303 = v679;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5405 v294->uSpecEnchantmentType = v679;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5406 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5407 v305 = v302 + 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5408 if ( v304 < v305 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5409 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5410 for ( jj = &v679; ; jj = (int *)v732 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5411 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5412 v307 = (int)(jj + 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5413 v732 = v307;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5414 v308 = *(int *)v307;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5415 v294->uSpecEnchantmentType = v308;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5416 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5417 if ( v304 >= v305 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5418 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5419 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5420 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5421 ++v294->uSpecEnchantmentType;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5422 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5423 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5424 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5425 v293 = rand();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5426 v294 = _this;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5427 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5428 _this->uEnchantmentType = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5429 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5430 ;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5431 kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5432 + 1] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5433 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5434 ++v294->uEnchantmentType;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5435 if ( kk >= v295 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5436 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5437 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5438 v294->_bonus_strength = 10//pItemsTable->field_116D8[18]
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5439 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5440 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5441 v294->uAttributes |= 0x20u;
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 961
diff changeset
5442 _50C9A8_item_enchantment_timer = 256;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5443 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5444 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5445 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5446 case SPELL_WATER_TOWN_PORTAL:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5447 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5448 amount = 10 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5449 if ( pPlayer->sMana < (signed int)uRequiredMana )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5450 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5451 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v731 != 4 || rand() % 100 >= amount && v731 != 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5452 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5453 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5454 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5455 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5456 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5457 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5458 town_portal_caster_id = LOBYTE(pCastSpell->uPlayerID);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5459 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5460 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5461 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5462 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5463 case SPELL_WATER_LLOYDS_BEACON:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5464 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5465 LODWORD(v733) = 604800 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5466 if ( !_strcmpi(pCurrentMapName, "d05.blv") )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5467 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5468 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5469 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5470 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5471 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5472 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5473 v319 = uRequiredMana;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5474 if ( pPlayer->sMana >= (signed int)uRequiredMana )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5475 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5476 pEventTimer->Pause();
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
5477 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastLloydsBeacon, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5478 qword_506350 = (signed int)v733;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5479 _506348_current_lloyd_playerid = pCastSpell->uPlayerID;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5480 ::uRequiredMana = v319;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5481 ::sRecoveryTime = sRecoveryTime;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5482 dword_50633C = pCastSpell->sound_id;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5483 dword_506338 = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5484 LOBYTE(pCastSpell->field_8) |= 0x20u;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5485 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5486 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5487 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5488 case SPELL_EARTH_STONE_TO_FLESH:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5489 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5490 __debugbreak(); // missing GM ?
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5491 if ( v731 == 1 || v731 == 2)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5492 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5493 if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5494 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5495 //LABEL_634:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5496 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5497 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5498 v323 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5499 v324 = (char *)&pParty->pPlayers[v323].pConditions[15];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5500 if ( !pParty->pPlayers[v323].pConditions[15] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5501 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5502 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5503 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5504 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5505 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5506 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5507 *(int *)v324 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5508 *((int *)v324 + 1) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5509 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5510 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5511 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5512 v732 = amount << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5513 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5514 v656 = 15;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5515 v325 = &pParty->pPlayers[v323];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5516 v325->DiscardConditionIfLastsLongerThan(v656, v663);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5517 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5518 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5519 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5520 case SPELL_EARTH_ROCK_BLAST:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5521 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5522 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5523 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5524 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5525 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5526 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5527 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5528 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5529 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5530 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5531 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5532 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5533 pSpellSprite.uSectorID = pIndoor->GetSector(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5534 pParty->vPosition.x,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5535 pParty->vPosition.y,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5536 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5537 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5538 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5539 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5540 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5541 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5542 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5543 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5544 LOBYTE(pSpellSprite.uAttributes) |= 4u;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5545
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5546 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5547 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5548 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5549 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5550 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5551 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5552 case SPELL_EARTH_DEATH_BLOSSOM:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5553 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5554 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5555 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5556 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5557 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5558 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5559 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5560 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5561 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5562 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5563 pSpellSprite.uType = 4090;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5564 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5565 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5566 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5567 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5568 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5569 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5570 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5571 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5572 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5573 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5574 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5575 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5576 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5577 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5578 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5579 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5580 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5581 pSpellSprite.uAttributes = 4;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5582
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5583 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5584 if ( pSpellSprite.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1 && pParty->bTurnBasedModeOn == 1 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5585 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5586 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5587 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5588 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5589 case SPELL_SPIRIT_DETECT_LIFE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5590 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5591 v328 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5592 if ( v328 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5593 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5594 v329 = v328 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5595 if ( v329 && v329 != 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5596 v330 = 600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5597 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5598 v330 = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5599 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5600 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5601 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5602 v330 = 1800 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5603 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5604 LODWORD(v733) = v330;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5605 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5606 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5607 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5608 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5609 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5610 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5611
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5612 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5613 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5614 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5615 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5616 case SPELL_SPIRIT_FATE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5617 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5618 LODWORD(v733) = 300;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5619 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5620 amount = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5621 else if( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5622 amount = 2 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5623 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5624 amount = 4 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5625 else if( v731 == 4)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5626 amount = 6 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5627 //LABEL_667:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5628 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5629 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5630 v342 = pCastSpell->spell_target_pid;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5631 if ( v342 == 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5632 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5633 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5634
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5635 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5636 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5637 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5638 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5639 if (PID_TYPE(v342) == OBJECT_Actor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5640 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5641 v343 = PID_ID(v342);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5642 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5643 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5644 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5645 BYTE2(pActors[v343].uAttributes) |= 8u;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5646 v672 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5647 v661 = &pActors[v343];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5648 //LABEL_165:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5649 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5650 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5651 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5652 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5653 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5654 case SPELL_SPIRIT_REMOVE_CURSE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5655 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5656 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5657 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5658 else if( v731 == 3)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5659 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5660 else if ( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5661 amount = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5662 //LABEL_679:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5663 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5664 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5665 v351 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5666 if ( !v351->pConditions[0] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5667 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5668 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5669 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5670 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5671 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5672 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5673 LODWORD(v351->pConditions[0]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5674 HIDWORD(v351->pConditions[0]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5675 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5676 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5677 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5678 v732 = amount << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5679 v351->DiscardConditionIfLastsLongerThan(0, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5680 if ( HIDWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5681 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5682 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5683 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5684 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5685 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5686 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5687 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5688 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5689 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5690 case SPELL_SPIRIT_PRESERVATION:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5691 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5692 v354 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5693 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5694 v356 = 900 * (v2 + 4);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5695 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5696 v356 = 300 * (v2 + 12);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5697 LODWORD(v733) = v356;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5698 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5699 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5700 if ( v731 == 1 || v731 == 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5701 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5702 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5703
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5704 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5705 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5706 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5707 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5708 a2 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5709 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5710 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5711 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5712 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5713 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5714 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5715 ++a2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5716 ++v357;// = (SpellBuff *)((char *)v357 + 6972);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5717 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5718 while ( v357 <= &pParty->pPlayers[3] );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5719 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5720 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5721 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5722 case SPELL_SPIRIT_TURN_UNDEAD:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5723 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5724 v364 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5725 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5726 v366 = 60 * (v2 + 3);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5727 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5728 v366 = 300 * v2 + 180;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5729 LODWORD(v733) = v366;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5730 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5731 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5732 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5733 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5734 ++pSpellSprite.uType;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5735 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5736 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5737 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5738 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5739 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5740 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5741 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5742 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5743 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5744 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5745 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5746 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5747 for ( a2 = 0; a2 < (signed int)_v726; ++a2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5748 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5749 v369 = &pActors[dword_50BF30[a2]];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5750 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5751 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5752 pSpellSprite.vPosition.x = v369->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5753 pSpellSprite.vPosition.y = v369->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5754 pSpellSprite.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v369->uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5755
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5756 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5757 pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5758 v369->pActorBuffs[4].Apply(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5759 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5760 v731, 0, 0, 0);
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5761 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5762 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5763 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5764 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5765 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5766
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5767 case SPELL_SPIRIT_RAISE_DEAD:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5768 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5769 v371 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5770 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5771 amount = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5772 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5773 amount = 86400 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5774 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5775 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5776 pOtherOverlayList->_4418B1(5080, pCastSpell->uPlayerID_2 + 100, 0, 65536);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5777 v373 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5778 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5779 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5780 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5781 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5782 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5783 v14 = v731 == 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5784 pParty->pPlayers[v373].sHealth = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5785 if ( v14 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5786 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5787 v374 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5788 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5789 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5790 v376 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5791 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5792 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5793 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5794 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5795 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5796 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5797 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5798 0xEu,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5799 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5800 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5801 0xDu,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5802 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5803 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5804 v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5805 v377->SetCondition(1, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5806 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5807 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5808 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5809 case SPELL_SPIRIT_SHARED_LIFE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5810 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5811 v378 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5812 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5813 v380 = 4 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5814 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5815 v380 = 3 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5816 amount = v380;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5817 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5818 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5819 v381 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5820 HIDWORD(v733) = amount;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5821 v730 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5822 v382 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5823 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5824 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5825 v383 = pPlayers[v382];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5826 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5827 v682[v381++] = v382;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5828 ++v382;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5829 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5830 while ( v382 <= 4 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5831 v384 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5832 v730 = v381;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5833 if ( v381 > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5834 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5835 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5836 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5837 while ( v384 < v381 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5838 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5839 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5840 HIDWORD(v733) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5841 if ( v381 > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5842 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5843 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5844 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5845 //v385 = (ItemGen **)&pPlayers[v682[HIDWORD(v733)]];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5846 v726 = pPlayers[v682[HIDWORD(v733)]];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5847 v726->sHealth = v732;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5848 //v386 = v726->GetMaxHealth();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5849 if ( v726->sHealth > v726->GetMaxHealth())
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5850 v726->sHealth = v726->GetMaxHealth();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5851 if ( v726->sHealth > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5852 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5853 v726->pConditions[Player::Condition_Unconcious] = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5854 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5855 v388 = HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5856
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5857 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5858 HIDWORD(v733) = v388 + 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5859 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5860 while ( v388 + 1 < v730 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5861 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5862 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5863 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5864 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5865 case SPELL_SPIRIT_RESSURECTION:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5866 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5867 v392 = v731 - 1;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5868 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5869 amount = 180 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5870 else if ( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5871 amount = 10800 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5872 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5873 amount = 259200 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5874 else if ( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5875 amount = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5876 //LABEL_751:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5877 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5878 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5879 v396 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5880 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16])
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5881 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5882 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5883 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5884 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5885 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5886 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5887 v397 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5888 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5889 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5890 v398 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5891 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5892 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5893 v399 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5894 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5895 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5896 }
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5897 else
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5898 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5899 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5900 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0x10u,
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5901 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5902 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xEu,
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5903 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5904 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xDu,
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5905 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5906 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5907 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(1u, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5908
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5909 pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5910
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5911 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5912 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5913 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5914 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5915 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5916 case SPELL_MIND_CURE_PARALYSIS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5917 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5918 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5919 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5920 else if ( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5921 amount = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5922 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5923 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5924 //LABEL_768:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5925 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5926 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5927
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5928 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5929 v323 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5930 v324 = (char *)&pParty->pPlayers[v323].pConditions[12];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5931 if ( !pParty->pPlayers[v323].pConditions[12] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5932 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5933 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5934 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5935 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5936 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5937 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5938 *(int *)v324 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5939 *((int *)v324 + 1) = 0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
5940 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5941 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5942 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5943 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5944 v656 = 12;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5945 v325 = &pParty->pPlayers[v323];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5946 v325->DiscardConditionIfLastsLongerThan(v656, v663);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5947 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5948 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5949 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5950 case SPELL_MIND_REMOVE_FEAR:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5951 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5952 if( v731 == 1)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5953 amount = 180 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5954 else if( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5955 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5956 else if( v731 == 3)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5957 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5958 else if( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5959 amount = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5960 //LABEL_780:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5961 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5962 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5963
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5964 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5965 v323 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5966 v324 = (char *)&pParty->pPlayers[v323].pConditions[3];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5967 if ( !pParty->pPlayers[v323].pConditions[3] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5968 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5969 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5970 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5971 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5972 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5973 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5974 *(int *)v324 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5975 *((int *)v324 + 1) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5976 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5977 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5978 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5979 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5980 v656 = 3;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
5981 v325 = &pParty->pPlayers[v323];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5982 v325->DiscardConditionIfLastsLongerThan(v656, v663);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5983 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5984 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5985 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
5986 case SPELL_MIND_TELEPATHY:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5987 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5988 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5989 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5990 if (PID_TYPE(a2) != OBJECT_Actor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5991 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5992 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5993 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5994 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5995 v417 = (int)&pActors[PID_ID(a2)];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5996 v730 = v417;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5997 if ( !(*(char *)(v417 + 38) & 0x80) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5998 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
5999 ((Actor *)v417)->SetRandomGoldIfTheresNoItem();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6000 v417 = v730;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6001 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6002 v418 = *(int *)(v417 + 672);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6003 HIDWORD(v733) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6004 if ( pItemsTable->pItems[v418].uEquipType == 18 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6005 HIDWORD(v733) = *(int *)(v417 + 684);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6006
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6007 //ItemGen::ItemGen(&v683);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6008 v683.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6009
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6010 v419 = *(short *)(v730 + 180);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6011 if (v419)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6012 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6013 v683.uItemID = v419;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6014 //goto LABEL_799;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6015 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6016 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6017 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6018 v420 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6019 v421 = v730 + 564;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6020 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6021 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6022 ++v420;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6023 v421 += 36;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6024 if ( v420 >= 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6025 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6026 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6027 if ( v420 < 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6028 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6029 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683));
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6030 v2 = v723;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6031 //v1 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6032 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6033 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6034 // LABEL_799:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6035 if ( HIDWORD(v733) != 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6036 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6037 v675 = (const char *)HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6038 if (v683.uItemID)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6039 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6040 v422 = v683.GetDisplayName();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6041 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6042 ShowStatusBarString(pTmpBuf2, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6043 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6044 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6045 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6046 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6047 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6048 pSpellSprite.vPosition.x = *(short *)(v730 + 142);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6049 pSpellSprite.vPosition.y = *(short *)(v730 + 144);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6050 v676 = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6051 v665 = pSpellSprite.vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6052 pSpellSprite.vPosition.z = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6053 v657 = pSpellSprite.vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6054 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6055 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6056 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6057 v664 = "%d gold";
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6058 sprintf(pTmpBuf2, v664, v675);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6059 ShowStatusBarString(pTmpBuf2, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6060 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6061 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6062 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6063 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6064 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6065 pSpellSprite.vPosition.x = *(short *)(v730 + 142);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6066 pSpellSprite.vPosition.y = *(short *)(v730 + 144);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6067 v676 = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6068 v665 = pSpellSprite.vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6069 pSpellSprite.vPosition.z = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6070 v657 = pSpellSprite.vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6071 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6072 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6073 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6074 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6075 if (v683.uItemID)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6076 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6077 v675 = v683.GetDisplayName();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6078 v664 = "(%s)";
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6079 sprintf(pTmpBuf2, v664, v675);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6080 ShowStatusBarString(pTmpBuf2, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6081 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6082 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6083 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6084 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6085 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6086 pSpellSprite.vPosition.x = *(short *)(v730 + 142);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6087 pSpellSprite.vPosition.y = *(short *)(v730 + 144);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6088 v676 = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6089 v665 = pSpellSprite.vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6090 pSpellSprite.vPosition.z = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6091 v657 = pSpellSprite.vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6092 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6093 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6094 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6095 strcpy(pTmpBuf2, "nothing");
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6096 ShowStatusBarString(pTmpBuf2, 2u);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6097 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6098 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6099 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6100 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6101 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6102 pSpellSprite.vPosition.x = *(short *)(v730 + 142);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6103 pSpellSprite.vPosition.y = *(short *)(v730 + 144);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6104 v676 = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6105 v665 = pSpellSprite.vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6106 pSpellSprite.vPosition.z = *(short *)(v730 + 138);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6107 v657 = pSpellSprite.vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6108 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6109 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6110 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6111 pSpellSprite.uSectorID = pIndoor->GetSector(v657, v665, v676);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6112 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6113 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6114 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6115 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6116 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6117 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6118 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6119 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6120 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6121 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6122 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6123 case SPELL_MIND_BERSERK:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6124 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6125 v423 = v731 - 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6126 if ( !v423 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6127 v425 = 300 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6128 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6129 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6130 v424 = v423 - 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6131 if ( v424 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6132 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6133 if ( v424 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6134 v425 = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6135 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6136 //LABEL_813:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6137 v425 = 300 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6138 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6139 else
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6140 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6141 v425 = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6142 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6143 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6144 amount = v425;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6145 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6146 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6147 v426 = PID_ID(a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6148 if (PID_TYPE(a2) != OBJECT_Actor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6149 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6150 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6151 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6152 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6153 v730 = 836 * v426;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6154 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6155 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6156 pActors[v426].pActorBuffs[1].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6157 pActors[v426].pActorBuffs[12].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6158 pActors[v426].pActorBuffs[9].Apply(
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6159 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6160 v731, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6161 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6162 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6163 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6164 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6165 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6166 pSpellSprite.spell_skill = v731;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6167 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6168 v61 = v426;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6169 v600 = pActors[v61].vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6170 v601 = pActors[v61].vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6171 pSpellSprite.uObjectDescID = v60;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6172 pSpellSprite.vPosition.x = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6173 v602 = pActors[v61].uActorHeight;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6174 v603 = pActors[v61].vPosition.z;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6175 pSpellSprite.vPosition.y = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6176 v676 = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6177 v665 = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6178 pSpellSprite.vPosition.z = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6179 v657 = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6180 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6181 pSpellSprite.uSectorID = pIndoor->GetSector(v657, v665, v676);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6182 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6183 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6184 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6185 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6186 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6187 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6188 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6189 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6190 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6191 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6192 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6193 case SPELL_MIND_ENSLAVE:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6194 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6195 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6196 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6197 amount = 600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6198 if (PID_TYPE(a2) != OBJECT_Actor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6199 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6200 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6201 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6202 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6203 v730 = 836 * PID_ID(a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6204 if ( MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6205 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6206 if ( stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6207 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6208 pActors[PID_ID(a2)].pActorBuffs[9].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6209 pActors[PID_ID(a2)].pActorBuffs[1].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6210 pActors[PID_ID(a2)].pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6211 v731, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6212 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6213 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6214 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6215 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6216 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6217 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6218 v61 = PID_ID(a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6219 v600 = pActors[v61].vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6220 v601 = pActors[v61].vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6221 pSpellSprite.uObjectDescID = v60;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6222 pSpellSprite.vPosition.x = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6223 v602 = pActors[v61].uActorHeight;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6224 v603 = pActors[v61].vPosition.z;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6225 pSpellSprite.vPosition.y = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6226 v676 = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6227 v665 = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6228 pSpellSprite.vPosition.z = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6229 v657 = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6230 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6231 pSpellSprite.uSectorID = pIndoor->GetSector(v657, v665, v676);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6232 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6233 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6234 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6235 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6236 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6237 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6238 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6239 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6240 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6241 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6242 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6243 case SPELL_MIND_MASS_FEAR:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6244 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6245 v428 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6246 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6247 v430 = 300 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6248 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6249 v430 = 180 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6250 amount = v430;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6251 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6252 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6253 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6254 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6255 ++pSpellSprite.uType;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6256 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6257 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6258 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6259 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6260 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6261 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6262 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6263 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6264 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6265 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6266 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6267 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6268 for ( a2 = 0; a2 < (signed int)_v726; ++a2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6269 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6270 v433 = &pActors[dword_50BF30[a2]];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6271 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6272 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6273 pSpellSprite.vPosition.x = v433->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6274 pSpellSprite.vPosition.y = v433->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6275 pSpellSprite.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v433->uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6276
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6277 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6278 pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6279 if ( stru_50C198.GetMagicalResistance(v433, 7u) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6280 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6281 v433->pActorBuffs[4].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6282 v731, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6283 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6284 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6285 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6286 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6287 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6288
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6289 case SPELL_MIND_CURE_INSANITY:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6290 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6291 v435 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6292 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6293 amount = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6294 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6295 amount = 86400 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6296 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6297 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6298
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6299 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6300 v440 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6301 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6302 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6303 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6304 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6305 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6306 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6307 v441 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6308 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6309 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6310 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6311 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6312 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6313 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(5u,
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6314 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6315 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6316 v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6317 //LABEL_720:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6318 v377->SetCondition(1, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6319 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6320 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6321 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6322 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6323 case SPELL_EARTH_TELEKINESIS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6324 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6325 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6326 amount = 2 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6327 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6328 amount = 3 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6329 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6330 amount = 4 * v2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6331 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6332 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6333 v445 = PID_ID(a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6334 if (PID_TYPE(a2) == OBJECT_Item)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6335 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6336 v449 = (char *)&pSpriteObjects[v445].stru_24;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6337 v450 = *(int *)v449;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6338 if ( pItemsTable->pItems[v450].uEquipType == 18 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6339 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6340 party_finds_gold(*((int *)v449 + 3), 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6341 viewparams->bRedrawGameUI = 1;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6342 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6343 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6344 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6345 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6346 ShowStatusBarString(pTmpBuf2, 2u);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6347 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6348 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6349 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6350 SpriteObject::OnInteraction(v445);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6351 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6352 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6353 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6354 if (PID_TYPE(a2) == OBJECT_Actor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6355 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6356 stru_50C198.LootActor(&pActors[v445]);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6357 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6358 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6359 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6360 if (PID_TYPE(a2) != OBJECT_Decoration)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6361 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6362 if (PID_TYPE(a2) != OBJECT_BModel)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6363 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6364 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6365 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6366 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6367 dword_507CD8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6368 v677 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6369 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6370 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6371 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6372 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6373
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6374 EventProcessor(v446, a2, v677);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6375 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6376 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6377 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6378 v447 = &pLevelDecorations[v445];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6379 dword_507CD8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6380 v448 = v447->field_16_event_id;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6381 if (v448)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6382 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6383 v677 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6384 v446 = v448;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6385 EventProcessor(v446, a2, v677);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6386 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6387 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6388 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6389 if ( v447->IsInteractive() )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6390 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6391 activeLevelDecoration = v447;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6392 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6393 activeLevelDecoration = NULL;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6394 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6395 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6396 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6397 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6398 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6399 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6400 case SPELL_BODY_CURE_WEAKNESS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6401 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6402 if ( v731 == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6403 amount = 180 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6404 else if( v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6405 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6406 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6407 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6408 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6409 amount = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6410 //LABEL_883:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6411 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6412 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6413
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6414 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6415 v323 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6416 v324 = (char *)&pParty->pPlayers[v323].pConditions[1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6417 if ( !pParty->pPlayers[v323].pConditions[1] )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6418 {
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6419 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6420 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6421 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6422 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6423 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6424 *(int *)v324 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6425 *((int *)v324 + 1) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6426 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6427 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6428 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6429 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6430 v656 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6431 v325 = &pParty->pPlayers[v323];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6432 v325->DiscardConditionIfLastsLongerThan(v656, v663);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6433 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6434 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6435 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6436 case SPELL_BODY_FIRST_AID:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6437 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6438 v457 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6439 if ( v457 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6440 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6441 v458 = v457 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6442 if ( v458 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6443 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6444 if ( v458 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6445 v459 = 5 * v2 + 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6446 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6447 v459 = 2 * v2 + 5;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6448 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6449 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6450 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6451 v459 = 4 * v2 + 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6452 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6453 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6454 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6455 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6456 v459 = 3 * v2 + 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6457 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6458 amount = v459;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6459 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6460 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6461 v460 = pCastSpell->spell_target_pid;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6462 if (!v460)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6463 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6464 pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6465 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6466 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6467 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6468 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6469 if (PID_TYPE(v460) == OBJECT_Actor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6470 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6471 v461 = &pActors[PID_ID(v460)];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6472 v462 = v461->uAIState;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6473 v463 = v461->pMonsterInfo.uHP;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6474 if ( v462 != 5 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6475 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6476 if ( v462 != 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6477 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6478 if ( v462 != 19 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6479 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6480 if ( v462 != 11 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6481 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6482 v461->sCurrentHP += amount;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6483 if ( v461->sCurrentHP > v463 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6484 v461->sCurrentHP = v463;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6485 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6486 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6487 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6488 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6489 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6490 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6491 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6492 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6493 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6494 case SPELL_BODY_CURE_POISON:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6495 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6496 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6497 amount = 3600 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6498 else if( v731 == 3)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6499 amount = 86400 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6500 else if ( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6501 amount = 0;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6502 //LABEL_912:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6503 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6504 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6505
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6506 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6507 v470 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6508 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6]))
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6509 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8]))
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6510 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6511 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6512 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6513 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6514 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6515 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6516 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6517 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6518 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6519 v471 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6520 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6521 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6522 v472 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6523 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6524 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6525 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6526 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6527 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6528 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6529 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6530 6u,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6531 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6532 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6533 8u,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6534 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6535 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6536 v656 = 10;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6537 v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6538 v325->DiscardConditionIfLastsLongerThan(v656, v663);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6539 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6540 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6541 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6542 case SPELL_BODY_PROTECTION_FROM_MAGIC:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6543 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6544 amount = v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6545 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6546 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6547 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6548
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6549 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6550 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6551 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6552 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6553
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6554 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6555 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6556 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6557 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6558 case SPELL_BODY_HAMMERHANDS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6559 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6560 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6561 amount = v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6562 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6563 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6564 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6565 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6566 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6567 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6568 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6569 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6570 v732 = (int)v733 << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6571 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6572 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6573 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6574 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6575
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6576 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6577 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6578 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6579 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6580 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6581
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6582 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6583 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6584 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6585 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6586 case SPELL_BODY_CURE_DISEASE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6587 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6588 v493 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6589 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6590 amount = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6591 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6592 amount = 86400 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6593 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6594 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6595
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6596 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6597 v498 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6598 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7]))
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6599 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9]))
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6600 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6601 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6602 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6603 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6604 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6605 if ( v731 == 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6606 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6607 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6608 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6609 v499 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6610 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6611 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6612 v500 = pCastSpell->uPlayerID_2;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6613 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6614 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6615 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6616 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6617 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6618 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6619 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6620 7u,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6621 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6622 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6623 9u,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6624 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6625 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6626 v656 = 11;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6627 //LABEL_937:
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6628 v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6629 //LABEL_641:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6630 v325->DiscardConditionIfLastsLongerThan(v656, v663);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6631 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6632 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6633 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6634 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6635 case SPELL_BODY_POWER_CURE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6636 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6637 amount = 5 * v2 + 10;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6638 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6639 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6640 v501 = pParty->pPlayers;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6641 int v1 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6642 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6643 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6644 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6645 v501->Heal(amount);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6646 ++v501;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6647 ++v1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6648 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6649 while ( (signed int)v501 < (signed int)pParty->pHirelings );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6650 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6651 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6652 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6653 case SPELL_LIGHT_DISPEL_MAGIC:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6654 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6655 sRecoveryTime -= v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6656 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6657 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6658
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6659 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6660 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6661 ++pSpellSprite.uType;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6662 HIDWORD(v733) = v505;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6663 v688.x = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6664 v688.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6665 v688.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6666 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6667 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6668 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6669 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6670 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6671 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6672 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6673 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6674 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6675 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6676 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6677 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6678 a2 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6679 if ( SHIDWORD(v733) > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6680 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6681 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6682 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6683 v507 = dword_50BF30[a2];
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6684 pSpellSprite.vPosition.x = pActors[v507].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6685 pSpellSprite.vPosition.y = pActors[v507].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6686 pSpellSprite.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v507].uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6687 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6688 v509 = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6689 v510 = a2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6690 DamageMonsterFromParty(PID(OBJECT_Item, v509), dword_50BF30[a2], (Vec3_int_ *)&v688);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6691 a2 = v510 + 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6692 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6693 while ( v510 + 1 < SHIDWORD(v733) );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6694 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6695 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6696 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6697 v511 = &pActors[dword_50BF30[a2]];
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6698 pSpellSprite.vPosition.x = v511->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6699 pSpellSprite.vPosition.y = v511->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6700 pSpellSprite.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v511->uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6701 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6702 pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6703 v513 = v511->pActorBuffs;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6704 for (int _v726 = 22; _v726 != 0; --_v726)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6705 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6706 v513->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6707 ++v513;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6708 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6709 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6710 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6711 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6712 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6713 case SPELL_LIGHT_SUMMON_ELEMENTAL:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6714 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6715 v514 = v731 - 2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6716 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6717 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6718 v516 = 300 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6719 amount = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6720 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6721 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6722 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6723 v516 = 900 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6724 amount = 3;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6725 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6726 else if ( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6727 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6728 v516 = 900 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6729 amount = 5;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6730 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6731 v733 = __PAIR__(0, v516);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6732
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6733 if ( (signed int)uNumActors > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6734 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6735 v518 = pActors;//[0].uAIState;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6736 auto _v726 = uNumActors;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6737 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6738 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6739 v519 = v518->uAIState;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6740 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, pCastSpell->uPlayerID) == v518->uSummonerID )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6741 ++HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6742 ++v518;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6743 --_v726;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6744 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6745 while ( _v726 != 0 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6746 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6747 if ( SHIDWORD(v733) >= amount )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6748 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6749 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6750 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6751 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6752 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6753 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6754 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6755 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6756 sub_44FA4C_spawn_light_elemental(pCastSpell->uPlayerID, v731, v733);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6757 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6758 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6759 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6760 case SPELL_LIGHT_DAY_OF_THE_GODS:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6761 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6762 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6763 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6764 LODWORD(v733) = 10800 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6765 amount = 3 * v2 + 10;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6766 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6767 else if( v731 == 3 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6768 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6769 LODWORD(v733) = 14400 * v2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6770 amount = 4 * v2 + 10;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6771 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6772 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6773 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6774 LODWORD(v733) = 18000 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6775 amount = 5 * v2 + 10;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6776 }
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6777 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6778 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6779
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6780 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6781 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6782 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6783 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6784
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6785 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6786 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6787 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6788 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6789 case SPELL_LIGHT_PRISMATIC_LIGHT:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6790 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6791 //v67 = 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6792 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6793 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6794 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6795 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6796 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6797 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6798 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6799 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6800 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6801 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6802 ++pSpellSprite.uType;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6803 v694.x = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6804 v694.y = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6805 v694.z = 0;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6806 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6807 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6808 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6809 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6810 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6811 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6812 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6813 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6814 pSpellSprite.field_60_distance_related_prolly_lod = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6815 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6816 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6817 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6818 a2 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6819 if ( (signed int)v531 > 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6820 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6821 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6822 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6823 v533 = dword_50BF30[a2];
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6824 pSpellSprite.vPosition.x = pActors[v533].vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6825 pSpellSprite.vPosition.y = pActors[v533].vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6826 pSpellSprite.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v533].uActorHeight * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6827 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6828 v535 = pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6829 v536 = a2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6830 DamageMonsterFromParty(PID(OBJECT_Item, v535), dword_50BF30[a2], &v694);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6831 a2 = v536 + 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6832 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6833 while ( v536 + 1 < (signed int)v531 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6834 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6835 v537 = pGame->GetStru6();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6836 pGame->GetStru6()->_4A8BFC();
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6837 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6838 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6839 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6840 case SPELL_LIGHT_DAY_OF_PROTECTION:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6841 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6842 v538 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6843 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6844 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6845 amount = 5 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6846 v540 = 18000 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6847 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6848 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6849 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6850 amount = 4 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6851 v540 = 14400 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6852 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6853 v730 = v540;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6854 LODWORD(v733) = v540;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6855 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6856 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6857
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6858 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6859 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6860 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6861 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6862
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6863 v732 = v730 << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6864 v549 = (double)(v730 << 7) * 0.033333335;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6865 *((float *)&v733 + 1) = v549;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6866 v712 = (signed __int64)v549;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6867 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6868 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6869 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6870 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6871 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6872 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6873 v550 = v2 + 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6874 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6875 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6876 v731,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6877 v550, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6878
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6879 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6880 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6881 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6882 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6883
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6884 case SPELL_LIGHT_HOUR_OF_POWER:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6885 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6886 v551 = v731 - 2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6887 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6888 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6889 HIDWORD(v733) = 4;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6890 amount = 4;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6891 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6892 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6893 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6894 HIDWORD(v733) = 12;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6895 amount = 12;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6896 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6897 else if( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6898 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6899 amount = 15;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6900 HIDWORD(v733) = 20;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6901 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
6902 //LABEL_1000:
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6903 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6904 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6905 y = (char *)(60 * (v2 * HIDWORD(v733) + 60));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6906 v732 = (300 * amount * v2 + 60) << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6907 v730 = v2 + 5;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6908 int _v726 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6909 v553 = pParty->pPlayers;//[0].pConditions[1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6910 *((float *)&v733 + 1) = (double)v732 * 0.033333335;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6911 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6912 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6913 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6914 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6915 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6916 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6917
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6918 //((SpellBuff *)(v553 + 6056))->Apply(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6919 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6920 if ( *(_QWORD *)v553 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6921 _v726 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6922 ++v553;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6923 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6924 while ( v553 <= &pParty->pPlayers[3] );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6925 v562 = v731;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6926 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6927 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6928 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6929 if (!_v726)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6930 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6931 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6932 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6933 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6934 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6935 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6936
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6937
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6938 case SPELL_LIGHT_DIVINE_INTERVENTION:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6939 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6940 amount = 3;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6941 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6942 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6943 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6944 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6945 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6946 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6947 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6948 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6949 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6950 a2 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6951 _this = (ItemGen *)&pPlayers[1];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6952 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6953 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6954 v563 = 0;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6955 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6956 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6957 v564 = _this->uItemID;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6958 *(int *)(v563 + _this->uItemID) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6959 v563 += 8;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6960 *(int *)(v563 + v564 - 4) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6961 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6962 while ( v563 <= 128 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6963 v565 = ((Player *)_this->uItemID)->GetMaxHealth();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6964 v566 = (Player **)_this;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6965 *(int *)(_this->uItemID + 6460) = v565;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6966 v567 = (*v566)->GetMaxMana();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6967 *(int *)(_this->uItemID + 6464) = v567;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
6968 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6969 ++a2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6970 _this = (ItemGen *)((char *)_this + 4);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6971 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6972 while ( (signed int)this < (signed int)&qword_A750D8 );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6973 v571 = pPlayer;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6974 v572 = (char *)&pPlayer->sAgeModifier;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6975 if ( pPlayer->sAgeModifier + 10 >= 120 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6976 *(short *)v572 = 120;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6977 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6978 *(short *)v572 = pPlayer->sAgeModifier + 10;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6979 sRecoveryTime += -5 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6980 ++v571->uNumDivineInterventionCastsThisDay;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6981 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6982 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6983 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6984 case SPELL_DARK_REANIMATE:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6985 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6986 v573 = v731 - 2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6987 if ( v573 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6988 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6989 v574 = v573 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6990 if ( v574 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6991 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6992 if ( v574 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6993 v575 = 5 * v2;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6994 else
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6995 v575 = 2 * v2;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6996 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6997 else
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
6998 {
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
6999 v575 = 4 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7000 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7001 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7002 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7003 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7004 v575 = 3 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7005 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7006 amount = v575;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7007 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7008 break;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7009 v576 = pCastSpell->spell_target_pid;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7010 if (!v576)
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7011 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7012 v585 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2];
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7013 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7014 if ( *((_QWORD *)v585 + 14) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7015 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7016 ((Player *)v585)->SetCondition(0x11u, 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7017 v587 = ((Player *)v585)->GetSexByVoice();
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7018 ReloadPlayerPortraits(pCastSpell->uPlayerID_2, (v587 != 0) + 23);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7019 *((_QWORD *)v585 + 17) = pParty->uTimePlayed;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7020 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7021 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7022 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7023 v577 = (Player *)(PID_ID(v576));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7024 //v726 = v577;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7025 if ( v577 == (Player *)-1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7026 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7027 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists!
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7028 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7029 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7030 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7031 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7032 v578 = (int)&pActors[(int)v577];
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7033 v721 = v578;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7034 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7035 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7036 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7037 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7038 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7039 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7040 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7041 ++pSpellSprite.uType;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7042 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7043 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7044 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7045 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7046 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7047 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7048 pSpellSprite.uSectorID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7049 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7050 pSpellSprite.field_60_distance_related_prolly_lod = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7051 v581 = v721;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7052 pSpellSprite.uFacing = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7053 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7054 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7055 pSpellSprite.vPosition.x = *(short *)(v721 + 142);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7056 pSpellSprite.vPosition.y = *(short *)(v721 + 144);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7057 v732 = *(short *)(v721 + 138);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7058 pSpellSprite.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7059 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, (int)v577);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7060 pSpellSprite.Create(0, 0, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7061 if ( *(char *)(v581 + 52) > amount )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7062 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7063 Actor::Resurrect((unsigned int)v577);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7064 *(char *)(v581 + 61) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7065 *(char *)(v581 + 53) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7066 *(char *)(v581 + 54) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7067 *(char *)(v581 + 55) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7068 *(char *)(v581 + 56) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7069 *(char *)(v581 + 57) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7070 *(int *)(v581 + 712) = 9999;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7071 *(char *)(v581 + 38) &= 0xF7u;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7072 *(int *)(v581 + 708) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7073 ((SpellBuff *)(v581 + 356))->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7074 ((SpellBuff *)(v581 + 228))->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7075 ((SpellBuff *)(v581 + 404))->Reset();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7076 if ( *(short *)(v581 + 40) > 10 * amount )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7077 *(short *)(v581 + 40) = 10 * amount;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7078 LODWORD(v727) = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7079 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7080 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7081 case SPELL_DARK_VAMPIRIC_WEAPON:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7082 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7083 v588 = v731 - 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7084 amount = 16;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7085 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7086 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7087 if ( v590 == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7088 LODWORD(v733) = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7089 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7090 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7091 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7092 LODWORD(v733) = 3600 * v2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7093 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7094 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7095 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7096 __debugbreak();
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7097 HIDWORD(v733) = (int)(char *)&pParty + 6972 * pCastSpell->uPlayerID_2 + 36 * a2 + 3040;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7098 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7099 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7100 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7101 || *(char *)(HIDWORD(v733) + 20) & 2
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7102 || *(int *)(HIDWORD(v733) + 12) != 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7103 || *(int *)(HIDWORD(v733) + 4) != 0
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7104 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7105 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7106 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7107 dword_50C9D0 = 113;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7108 dword_50C9D4 = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7109 dword_50C9D8 = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7110
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7111 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7112 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7113 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7114 continue;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7115 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7116 v592 = HIDWORD(v733);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7117 v14 = v731 == 4;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7118 *(int *)(HIDWORD(v733) + 12) = 16;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7119 if ( !v14 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7120 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7121 v732 = (int)v733 << 7;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7122 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7123 *(int *)(v592 + 20) |= 8u;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7124 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7125 *(char *)(v592 + 20) |= 0x80u;
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 961
diff changeset
7126 _50C9A8_item_enchantment_timer = 256;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7127 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7128 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7129 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7130 case SPELL_DARK_SHARPMETAL:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7131 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7132 v593 = v731 - 2;
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7133 if( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7134 amount = 5;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7135 else if( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7136 amount = 7;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7137 else if( v731 == 4 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7138 amount = 9;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7139 if ( !pPlayer->CanCastSpell(uRequiredMana) )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7140 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7141 auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7142 pSpellSprite.stru_24.Reset();
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7143 pSpellSprite.spell_id = pCastSpell->spellnum;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7144 pSpellSprite.spell_level = v2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7145 pSpellSprite.spell_skill = v731;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7146 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7147 pSpellSprite.vPosition.x = pParty->vPosition.x;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7148 pSpellSprite.vPosition.y = pParty->vPosition.y;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7149 pSpellSprite.uAttributes = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7150 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7151 pSpellSprite.uSectorID = pIndoor->GetSector(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7152 pParty->vPosition.x,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7153 pParty->vPosition.y,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7154 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2);
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7155 pSpellSprite.uSpriteFrameID = 0;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7156 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7157 pSpellSprite.spell_target_pid = a2;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7158 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7159 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7160 if ( pParty->bTurnBasedModeOn == 1 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7161 LOBYTE(pSpellSprite.uAttributes) |= 4u;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7162 v596 = (signed int)_v726 / -2;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7163 y = (char *)((signed int)_v726 / 2);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7164 if ( (signed int)_v726 / -2 <= (signed int)_v726 / 2 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7165 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7166 v597 = v715.uYawAngle;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7167 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7168 {
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7169 pSpellSprite.uFacing = v596 + v597;
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7170 if ( pSpellSprite.Create(
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7171 v596 + v597,
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7172 v715.uPitchAngle,
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7173 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7174 pCastSpell->uPlayerID + 1) != -1
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7175 && pParty->bTurnBasedModeOn == 1 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7176 ++pTurnEngine->field_1C;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7177 v596 += _v726 / (amount - 1);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7178 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7179 while ( v596 <= (signed int)y );
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7180 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7181 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7182 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7183 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7184
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7185 case SPELL_DARK_CONTROL_UNDEAD:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7186 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7187 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7188 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7189 if ( v731 == 1 || v731 == 2 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7190 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7191 v598 = 180 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7192 LODWORD(v733) = v598;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7193 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7194 else if ( v731 == 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7195 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7196 v598 = 300 * v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7197 LODWORD(v733) = v598;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7198 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7199 else if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7200 LODWORD(v733) = 29030400;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7201 // LABEL_1082:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7202 if (PID_TYPE(a2) != OBJECT_Actor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7203 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7204 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7205 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7206 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7207 v730 = 836 * PID_ID(a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7208 if ( !MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7209 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7210 if ( !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 0xAu) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7211 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7212 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7213 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7214 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7215 continue;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7216 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7217 pActors[PID_ID(a2)].pActorBuffs[9].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7218 pActors[PID_ID(a2)].pActorBuffs[1].Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7219 pActors[PID_ID(a2)].pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7220 v731, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7221 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7222 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7223 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7224 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7225 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7226 v61 = PID_ID(a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7227 // LABEL_1086:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7228 v600 = pActors[v61].vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7229 v601 = pActors[v61].vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7230 pSpellSprite.uObjectDescID = v60;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7231 pSpellSprite.vPosition.x = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7232 v602 = pActors[v61].uActorHeight;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7233 v603 = pActors[v61].vPosition.z;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7234 pSpellSprite.vPosition.y = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7235 v676 = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7236 v665 = v600;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7237 pSpellSprite.vPosition.z = v603 + v602;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7238 v657 = v601;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7239 // LABEL_1087:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7240 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7241 pSpellSprite.uSectorID = pIndoor->GetSector(v657, v665, v676);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7242 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7243 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7244 pSpellSprite.spell_target_pid = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7245 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7246 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7247 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7248 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7249 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7250 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7251 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7252 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7253 case SPELL_DARK_SACRIFICE:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7254 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7255 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7256 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7257 HIDWORD(v733) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7258 memset(&achieved_awards, 0, 4000);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7259 _this = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7260 v605 = (char *)pParty->pHirelings;
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7261 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7262 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7263 if ( *(int *)v605)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7264 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7265 v606 = HIDWORD(v733)++;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7266 achieved_awards[v606] = (AwardType)(int)((char *)&_this->uItemID + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7267 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7268 _this = (ItemGen *)((char *)_this + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7269 v605 += 76;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7270 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7271 while ( (signed int)v605 < (signed int)&pParty->pPickedItem );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7272 _this = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7273 if ( (signed int)pNPCStats->uNumNewNPCs > 0)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7274 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7275 v730 = (int)pNPCStats->pNewNPCData;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7276 __debugbreak(); // data offset
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7277 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7278 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7279 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7280 if ( *(char *)(v730 + 8) & 0x80
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7281 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName))
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7282 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7283 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7284 v607 = HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7285 HIDWORD(v733) += 4;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7286 *(int *)v607 = (int)_this + 3;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7287 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7288 _this = (ItemGen *)((char *)_this + 1);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7289 v730 += 76;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7290 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7291 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7292 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7293 v608 = pCastSpell->uPlayerID_2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7294 if ( v608 != 4 && v608 != 5
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7295 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7296 || v609 >= 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7297 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7298 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7299 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7300 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7301 continue;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7302 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7303 v610 = 76 * v609;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7304 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7305 v611 = pIconsFrameTable->FindIcon("spell96");
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7306 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7307 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7308 v612 = pParty->pPlayers;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7309 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7310 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7311 v612->sHealth = v612->GetMaxHealth();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7312 v612->sMana = v612->GetMaxMana();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7313 ++v612;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7314 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7315 while ( v612 <= &pParty->pPlayers[3] );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7316 v613 = &pOutdoor->ddm;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7317 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7318 v613 = &pIndoor->dlv;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7319 v613->uReputation += 15;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7320 if ( v613->uReputation > 10000 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7321 v613->uReputation = 10000;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7322 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7323 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7324 }
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7325 case SPELL_DARK_PAIN_REFLECTION:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7326 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7327 if ( v731 > 0 && v731 <= 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7328 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7329 if ( v731 <= 3 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7330 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7331 v614 = 300 * (v2 + 12);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7332 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7333 if ( v731 == 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7334 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7335 v614 = 900 * (v2 + 4);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7336 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7337 LODWORD(v733) = v614;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7338 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7339 v615 = v2 + 5;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7340 amount = v615;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7341 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7342 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7343 if ( v731 != 3 && v731 != 4 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7344 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7345 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7346
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7347 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v615, v716, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7348 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7349 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7350 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7351 a2 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7352 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7353 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10];
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7354 do
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7355 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7356 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7357 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7358 ++a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7359 ++v619;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7360 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7361 while ( v619 <= &pParty->pPlayers[3] );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7362 LODWORD(v727) = 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7363 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7364 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7365 case SPELL_DARK_SOULDRINKER:
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7366 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7367 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7368 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7369 pGame->GetIndoorCamera();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7370 v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7371 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7372 v707.x = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7373 v707.y = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7374 v707.z = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7375 pSpellSprite.stru_24.Reset();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7376 pSpellSprite.spell_id = pCastSpell->spellnum;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7377 pSpellSprite.spell_level = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7378 pSpellSprite.spell_skill = v731;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7379 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7380 pSpellSprite.uAttributes = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7381 pSpellSprite.uSectorID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7382 pSpellSprite.uSpriteFrameID = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7383 pSpellSprite.field_60_distance_related_prolly_lod = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7384 pSpellSprite.uFacing = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7385 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7386 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7387 a2 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7388 int _v726 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7389 if ( SHIDWORD(v733) > 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7390 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7391 _v726 = (HIDWORD(v733) * (7 * v2 + 25));
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7392 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7393 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7394 v625 = dword_50BF30[a2];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7395 pSpellSprite.vPosition.x = pActors[v625].vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7396 pSpellSprite.vPosition.y = pActors[v625].vPosition.y;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7397 //v732 = pActors[v625].uActorHeight;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7398 pSpellSprite.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v625].uActorHeight * unk_4D8548);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7399 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7400 v627 = pSpellSprite.Create(0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7401 v628 = a2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7402 DamageMonsterFromParty(PID(OBJECT_Item, v627), dword_50BF30[a2], &v707);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7403 a2 = v628 + 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7404 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7405 while ( v628 + 1 < SHIDWORD(v733) );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7406 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7407 v730 = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7408 v629 = 1;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7409 do
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7410 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7411 v630 = pPlayers[v629];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7412 if ( !v630->pConditions[2]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7413 && !v630->pConditions[12]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7414 && !v630->pConditions[13]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7415 && !v630->pConditions[14]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7416 && !v630->pConditions[15]
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7417 && !v630->pConditions[16] )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7418 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7419 v631 = v730++;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7420 v681[v631] = v629;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7421 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7422 ++v629;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7423 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7424 while ( v629 <= 4 );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7425 v732 = (signed __int64)((double)(signed int)_v726 / (double)v730);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7426 HIDWORD(v733) = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7427 if ( v730 > 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7428 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7429 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7430 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7431 //v632 = 4 * v681[HIDWORD(v733)] + 10965188;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7432 v726 = pPlayers[v681[HIDWORD(v733)]];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7433 //v633 = pPlayers[v681[HIDWORD(v733)]];
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7434 v726->sHealth += v732;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7435 //v726 = *(Player **)v632;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7436 //v634 = v726->GetMaxHealth();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7437 if ( v726->sHealth > v726->GetMaxHealth())
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7438 v726->sHealth = v726->GetMaxHealth();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7439 v635 = HIDWORD(v733);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7440
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7441 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, WORD2(v733));
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7442 HIDWORD(v733) = v635 + 1;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7443 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7444 while ( v635 + 1 < v730 );
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7445 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7446 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7447 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7448 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7449 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7450
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7451 case SPELL_DARK_ARMAGEDDON:
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7452 {
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7453 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7454 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7455 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors!
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7456 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7457 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7458 continue;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7459 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7460 v640 = v731 - 2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7461 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7462 amount = 3;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7463 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7464 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7465 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7466 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7467 pCastSpell->spellnum = 0;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7468 continue;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7469 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7470 if ( !pPlayer->CanCastSpell(uRequiredMana) )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7471 break;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7472 pParty->armageddon_timer = 256;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7473 pParty->field_16140 = v2;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7474 ++pPlayer->uNumArmageddonCasts;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7475 if ( pParty->bTurnBasedModeOn == 1 )
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7476 ++pTurnEngine->field_1C;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7477 auto _v726 = 50;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7478 do
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7479 {
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7480 v642 = rand() % 4096 - 2048;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7481 v643 = rand();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7482 v721 = v642 + pParty->vPosition.x;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7483 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7484 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7485 v644 = rand();
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7486 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0);
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7487 --_v726;
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7488 }
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7489 while ( _v726 != 0 );
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7490 LODWORD(v727) = 1;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7491 break;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7492 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7493
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7494 default:
993
ada1ed5f44a1 CastSpellInfo::_427E01_cast_spell cleaned from gotos
zipi
parents: 990
diff changeset
7495 break;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7496 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7497 if ( pCastSpell->field_8 & 0x20 )
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7498 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7499 if ( v727 != 0.0 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7500 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7501 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7502 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7503 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7504 if ( sRecoveryTime < 0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7505 sRecoveryTime = 0;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7506 if ( pParty->bTurnBasedModeOn )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7507 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7508 v645 = sRecoveryTime;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7509 pParty->pTurnBasedPlayerRecoveryTimes[pCastSpell->uPlayerID] = sRecoveryTime;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7510 pPlayer->SetRecoveryTime(v645);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7511 if ( !some_active_character )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7512 pTurnEngine->_40471C();
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7513 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7514 else
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7515 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7516 pPlayer->SetRecoveryTime(
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7517 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7518 }
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7519 if ( v727 != 0.0 )
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7520 {
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7521 pPlayer->PlaySound(SPEECH_49, 0);
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7522 if ( v727 != 0.0 )
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7523 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
889
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7524 }
279a315ff122 * first cast_spell clean
zipi
parents: 888
diff changeset
7525 }
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7526 pCastSpell->spellnum = 0;
890
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7527 v2 = v723;
dba25247e74f massive cast spell clean
zipi
parents: 889
diff changeset
7528 continue;
0
Ritor1
parents:
diff changeset
7529 }
488
Nomad
parents: 486
diff changeset
7530
0
Ritor1
parents:
diff changeset
7531 }
Ritor1
parents:
diff changeset
7532 //----- (0042EB42) --------------------------------------------------------
Ritor1
parents:
diff changeset
7533 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID)
Ritor1
parents:
diff changeset
7534 {
Ritor1
parents:
diff changeset
7535 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
7536 signed int v3; // eax@1
Ritor1
parents:
diff changeset
7537 char *v4; // ecx@2
Ritor1
parents:
diff changeset
7538
Ritor1
parents:
diff changeset
7539 v2 = this->uNumObjects;
Ritor1
parents:
diff changeset
7540 v3 = 0;
Ritor1
parents:
diff changeset
7541 if ( (signed int)this->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
7542 {
Ritor1
parents:
diff changeset
7543 LABEL_5:
Ritor1
parents:
diff changeset
7544 LOWORD(v3) = 0;
Ritor1
parents:
diff changeset
7545 }
Ritor1
parents:
diff changeset
7546 else
Ritor1
parents:
diff changeset
7547 {
Ritor1
parents:
diff changeset
7548 v4 = (char *)&this->pObjects->uObjectID;
Ritor1
parents:
diff changeset
7549 while ( uItemID != *(short *)v4 )
Ritor1
parents:
diff changeset
7550 {
Ritor1
parents:
diff changeset
7551 ++v3;
Ritor1
parents:
diff changeset
7552 v4 += 56;
Ritor1
parents:
diff changeset
7553 if ( v3 >= (signed int)v2 )
Ritor1
parents:
diff changeset
7554 goto LABEL_5;
Ritor1
parents:
diff changeset
7555 }
Ritor1
parents:
diff changeset
7556 }
Ritor1
parents:
diff changeset
7557 return v3;
Ritor1
parents:
diff changeset
7558 }
Ritor1
parents:
diff changeset
7559
Ritor1
parents:
diff changeset
7560 //----- (0042EB78) --------------------------------------------------------
Ritor1
parents:
diff changeset
7561 int IconFrameTable::GetIconAnimLength(unsigned int uIconID)
Ritor1
parents:
diff changeset
7562 {
Ritor1
parents:
diff changeset
7563 return 8 * this->pIcons[uIconID].uAnimLength;
Ritor1
parents:
diff changeset
7564 }
Ritor1
parents:
diff changeset
7565
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7566 const wchar_t *UIMessage2String(UIMessageType msg)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7567 {
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7568 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7569 static wchar_t b[256]; // bad for threads
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7570 switch (msg)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7571 {
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7572 CASE(UIMSG_SelectSpell)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7573 CASE(UIMSG_ChangeGameState)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7574 CASE(UIMSG_Attack)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7575 CASE(UIMSG_PlayArcomage)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7576 CASE(UIMSG_MainMenu_ShowPartyCreationWnd)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7577 CASE(UIMSG_MainMenu_ShowLoadWindow)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7578 CASE(UIMSG_ShowCredits)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7579 CASE(UIMSG_ExitToWindows)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7580 CASE(UIMSG_PlayerCreationChangeName)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7581 CASE(UIMSG_PlayerCreationClickPlus)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7582 CASE(UIMSG_PlayerCreationClickMinus)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7583 CASE(UIMSG_PlayerCreationSelectActiveSkill)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7584 CASE(UIMSG_PlayerCreationSelectClass)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7585 CASE(UIMSG_PlayerCreationClickOK)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7586 CASE(UIMSG_PlayerCreationClickReset)
996
bdbbdfa77ea6 UIMSG_ClickBooksBtn
Ritor1
parents: 990
diff changeset
7587 CASE(UIMSG_ClickBooksBtn)
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7588 CASE(UIMSG_PlayerCreationRemoveUpSkill)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7589 CASE(UIMSG_PlayerCreationRemoveDownSkill)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7590 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7591 CASE(UIMSG_LoadGame)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7592 CASE(UIMSG_SaveGame)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7593 CASE(UIMSG_ShowStatus_DateTime)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7594 CASE(UIMSG_ShowStatus_ManaHP)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7595 CASE(UIMSG_ShowStatus_Player)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7596 CASE(UIMSG_Wait5Minutes)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7597 CASE(UIMSG_Wait1Hour)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7598 CASE(UIMSG_ShowStatus_Food)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7599 CASE(UIMSG_ShowStatus_Funds)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7600 CASE(UIMSG_QuickReference)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7601 CASE(UIMSG_GameMenuButton)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7602 CASE(UIMSG_AlreadyResting)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7603 CASE(UIMSG_SelectCharacter)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7604 CASE(UIMSG_ChangeSoundVolume)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7605 CASE(UIMSG_ChangeMusicVolume)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7606 CASE(UIMSG_Escape)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7607 CASE(UIMSG_PlayerCreation_SelectAttribute)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7608 CASE(UIMSG_InventoryLeftClick)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7609 CASE(UIMSG_SkillUp)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7610 CASE(UIMSG_GameMenu_ReturnToGame)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7611 CASE(UIMSG_StartNewGame)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7612 CASE(UIMSG_Game_OpenLoadGameDialog)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7613 CASE(UIMSG_Game_OpenSaveGameDialog)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7614 CASE(UIMSG_Game_OpenOptionsDialog)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7615 CASE(UIMSG_SetGraphicsMode)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7616 CASE(UIMSG_Quit)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7617 CASE(UIMSG_StartHireling1Dialogue)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7618 CASE(UIMSG_StartHireling2Dialogue)
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 597
diff changeset
7619 CASE(UIMSG_SelectNPCDialogueOption)
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7620 CASE(UIMSG_CastSpellFromBook)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7621 CASE(UIMSG_PlayerCreation_VoicePrev)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7622 CASE(UIMSG_PlayerCreation_VoiceNext)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7623 CASE(UIMSG_StartNPCDialogue)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7624 CASE(UIMSG_ArrowUp)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7625 CASE(UIMSG_DownArrow)
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
7626 CASE(UIMSG_SaveLoadBtn)
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7627 CASE(UIMSG_SelectLoadSlot)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7628 CASE(UIMSG_Cancel)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7629 CASE(UIMSG_ExitRest)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7630 CASE(UIMSG_PlayerCreation_FacePrev)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7631 CASE(UIMSG_PlayerCreation_FaceNext)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7632 CASE(UIMSG_CycleCharacters)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7633 CASE(UIMSG_SetTurnSpeed)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7634 CASE(UIMSG_ToggleWalkSound)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7635 CASE(UIMSG_ChangeVoiceVolume)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7636 CASE(UIMSG_ToggleShowDamage)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7637 CASE(UIMSG_ScrollNPCPanel)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7638 CASE(UIMSG_ShowFinalWindow)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7639 CASE(UIMSG_OpenQuestBook)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7640 CASE(UIMSG_OpenAutonotes)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7641 CASE(UIMSG_OpenMapBook)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7642 CASE(UIMSG_OpenCalendar)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7643 CASE(UIMSG_OpenHistoryBook)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7644 CASE(UIMSG_ToggleAlwaysRun)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7645 CASE(UIMSG_ToggleFlipOnExit)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7646 CASE(UIMSG_Game_Action)
907
f3ccfc765502 RentRoom
Ritor1
parents: 893
diff changeset
7647 CASE(UIMSG_RentRoom)
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7648 CASE(UIMSG_TransitionUI_Confirm)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7649 CASE(UIMSG_OpenKeyMappingOptions)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7650 CASE(UIMSG_SelectKeyPage1)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7651 CASE(UIMSG_SelectKeyPage2)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7652 CASE(UIMSG_ResetKeyMapping)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7653 CASE(UIMSG_ChangeKeyButton)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7654 CASE(UIMSG_OpenVideoOptions)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7655 CASE(UIMSG_ToggleBloodsplats)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7656 CASE(UIMSG_ToggleColoredLights)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7657 CASE(UIMSG_ToggleTint)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7658 default:
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7659 _swprintf(b, L"UIMSG_%03X", msg); return b;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7660 };
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7661 #undef CASE
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7662 }
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7663
0
Ritor1
parents:
diff changeset
7664 //----- (0042EB8D) --------------------------------------------------------
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7665 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line)
0
Ritor1
parents:
diff changeset
7666 {
482
9898e6b413d8 some debug stuff commented
Nomad
parents: 469
diff changeset
7667 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line);
0
Ritor1
parents:
diff changeset
7668 if (uNumMessages < 40)
Ritor1
parents:
diff changeset
7669 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7670 files[uNumMessages] = file;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7671 lines[uNumMessages] = line;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
7672
0
Ritor1
parents:
diff changeset
7673 pMessages[uNumMessages].eType = msg;
Ritor1
parents:
diff changeset
7674 pMessages[uNumMessages].param = param;
Ritor1
parents:
diff changeset
7675 pMessages[uNumMessages++].field_8 = a4;
Ritor1
parents:
diff changeset
7676 }
Ritor1
parents:
diff changeset
7677 }
Ritor1
parents:
diff changeset
7678
Ritor1
parents:
diff changeset
7679 //----- (0042EBBE) --------------------------------------------------------
Ritor1
parents:
diff changeset
7680 int __fastcall sub_42EBBE(int a1, int a2)
Ritor1
parents:
diff changeset
7681 {
Ritor1
parents:
diff changeset
7682 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16;
Ritor1
parents:
diff changeset
7683 }
Ritor1
parents:
diff changeset
7684 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int);
Ritor1
parents:
diff changeset
7685
Ritor1
parents:
diff changeset
7686 //----- (0042EBDB) --------------------------------------------------------
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
7687 int stru193_math::Sin(int angle)
0
Ritor1
parents:
diff changeset
7688 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
7689 return Cos(angle - this->uIntegerHalfPi);
0
Ritor1
parents:
diff changeset
7690 }
Ritor1
parents:
diff changeset
7691
Ritor1
parents:
diff changeset
7692 //----- (0042ECB5) --------------------------------------------------------
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7693 void _42ECB5_PlayerAttacksActor()
0
Ritor1
parents:
diff changeset
7694 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7695 //unsigned int v0; // ebx@1
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7696 //Player *v1; // esi@1
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7697 //bool result; // eax@1
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7698 //int v3; // edi@2
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7699 //unsigned int v4; // eax@7
0
Ritor1
parents:
diff changeset
7700 char *v5; // eax@8
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7701 //int v6; // ecx@9
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7702 //signed int v7; // eax@16
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7703 //Actor *v8; // edi@20
0
Ritor1
parents:
diff changeset
7704 unsigned int v9; // ecx@21
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7705 //char *v10; // eax@26
0
Ritor1
parents:
diff changeset
7706 char *v11; // eax@26
Ritor1
parents:
diff changeset
7707 unsigned int v12; // eax@47
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7708 //char *v13; // eax@47
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7709 //char *v14; // eax@47
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7710 //unsigned int v15; // ebx@54
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7711 //int v16; // [sp-10h] [bp-4Ch]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7712 //int v17; // [sp-10h] [bp-4Ch]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7713 //unsigned int v18; // [sp-Ch] [bp-48h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7714 //unsigned int v19; // [sp-Ch] [bp-48h]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7715 //__int16 v20; // [sp-8h] [bp-44h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7716 //__int16 v21; // [sp-8h] [bp-44h]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7717 //int v22; // [sp-4h] [bp-40h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7718 //int v23; // [sp-4h] [bp-40h]@44
0
Ritor1
parents:
diff changeset
7719 SoundID v24; // [sp-4h] [bp-40h]@58
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7720 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7721 //unsigned int a2; // [sp+18h] [bp-24h]@20
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7722 //unsigned int v27; // [sp+1Ch] [bp-20h]@1
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7723 //int v28; // [sp+20h] [bp-1Ch]@9
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7724 //unsigned int *v28b;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7725 //int v29; // [sp+24h] [bp-18h]@16
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7726 //int v30; // [sp+28h] [bp-14h]@16
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7727 //int v31; // [sp+2Ch] [bp-10h]@4
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7728 //int v32; // [sp+30h] [bp-Ch]@7
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7729 //int v33; // [sp+34h] [bp-8h]@7
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7730 //int v34; // [sp+38h] [bp-4h]@17
0
Ritor1
parents:
diff changeset
7731
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7732 //v0 = uActiveCharacter;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7733 //v27 = 6972 * uActiveCharacter;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7734 //v1 = &pParty->pPlayers[uActiveCharacter-1];
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7735 //result = pParty->pPlayers[uActiveCharacter-1].CanAct();
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7736 auto player = &pParty->pPlayers[uActiveCharacter - 1];
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7737 if (!player->CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7738 return;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7739
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
7740 pCastSpellInfo->_427D48(uActiveCharacter);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7741 //v3 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7742 if (pParty->Invisible())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7743 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7744
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7745 //v31 = player->pEquipment.uBow;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7746 int bow_idx = player->pEquipment.uBow;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7747 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7748 bow_idx = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7749
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7750 //v32 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7751 int wand_item_id = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7752 //v33 = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7753 //v4 = v1->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7754 int laser_weapon_item_id = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7755
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7756 int main_hand_idx = player->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7757 if (main_hand_idx)
0
Ritor1
parents:
diff changeset
7758 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7759 auto item = &player->pInventoryItems[main_hand_idx - 1];
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7760 //v5 = (char *)v1 + 36 * v4;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7761 if (!item->Broken())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7762 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7763 //v28b = &v1->pInventoryItems[v4].uItemID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7764 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7765 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND)
0
Ritor1
parents:
diff changeset
7766 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7767 if (item->uNumCharges <= 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7768 player->pEquipment.uMainHand = 0; // wand discharged - unequip
0
Ritor1
parents:
diff changeset
7769 else
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7770 wand_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
7771 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7772 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7773 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
7774 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7775 }
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7776
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7777 //v30 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7778 //v29 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7779 //v28 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7780 //v7 = pMouse->uPointingObjectID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7781
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7782 int target_pid = pMouse->uPointingObjectID;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
7783 int target_type = PID_TYPE(target_pid),
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
7784 target_id = PID_ID(target_pid);
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7785 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7786 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7787 target_pid = stru_50C198.FindClosestActor(5120, 0, 0);
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
7788 target_type = PID_TYPE(target_pid);
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
7789 target_id = PID_ID(target_pid);
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7790 }
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7791
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7792 auto actor = &pActors[target_id];
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7793 int actor_distance = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7794 if (target_type == OBJECT_Actor)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7795 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7796 int distance_x = actor->vPosition.x - pParty->vPosition.x,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7797 distance_y = actor->vPosition.y - pParty->vPosition.y,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7798 distance_z = actor->vPosition.z - pParty->vPosition.z;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7799 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
7800 if (actor_distance < 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7801 actor_distance = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7802 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7803
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7804 bool shooting_bow = false,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7805 shotting_laser = false,
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7806 shooting_wand = false,
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7807 melee_attack = false;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7808 if (laser_weapon_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7809 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7810 shotting_laser = true;
490
Nomad
parents: 488
diff changeset
7811 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7812 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7813 else if (wand_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7814 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7815 shooting_wand = true;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7816
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7817 int main_hand_idx = player->pEquipment.uMainHand;
490
Nomad
parents: 488
diff changeset
7818 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7819
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7820 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7821 player->pEquipment.uMainHand = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7822 }
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7823 else if (target_type == OBJECT_Actor && actor_distance <= 407.2)
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7824 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7825 melee_attack = true;
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7826
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7827 Vec3_int_ a3;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7828 a3.x = actor->vPosition.x - pParty->vPosition.x;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7829 a3.y = actor->vPosition.y - pParty->vPosition.y;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7830 a3.z = actor->vPosition.z - pParty->vPosition.z;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7831 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z);
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7832
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
7833 DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3);
305
cc8e4dc397ec MonsterPopup_Draw crash fix
Nomad
parents: 303
diff changeset
7834 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7835 _42FA66_do_explosive_impact(
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7836 actor->vPosition.x,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7837 actor->vPosition.y,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7838 actor->vPosition.z + actor->uActorHeight / 2,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7839 0, 512, uActiveCharacter);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7840 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7841 else if (bow_idx)
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7842 {
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7843 shooting_bow = true;
490
Nomad
parents: 488
diff changeset
7844 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7845 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7846 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7847 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7848 melee_attack = true;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7849 ; // actor out of range or no actor; no ranged weapon so melee attacking air
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7850 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7851
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7852 if (!pParty->bTurnBasedModeOn && melee_attack) // wands, bows & lasers will add recovery while shooting spell effect
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7853 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7854 int recovery = player->GetAttackRecoveryTime(false);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7855 if (recovery < 30 )
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7856 recovery = 30;
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7857 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7858 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7859
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7860
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7861 int v34 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7862 if (shooting_wand)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7863 return;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7864 else if (shooting_bow)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7865 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7866 v34 = 5;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7867 player->PlaySound(SPEECH_50, 0);
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7868 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7869 if (shotting_laser)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7870 v34 = 7;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7871 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7872 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7873 int main_hand_idx = player->pEquipment.uMainHand;
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
7874 if (player->HasItemEquipped(EQUIP_MAIN_HAND))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7875 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7876 pTurnEngine->_40471C();
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7877 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7878
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7879 switch (v34)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7880 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7881 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7882 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7883 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7884 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7885 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7886 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7887 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7888 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7889 }
0
Ritor1
parents:
diff changeset
7890 }
Ritor1
parents:
diff changeset
7891
Ritor1
parents:
diff changeset
7892 //----- (0042F184) --------------------------------------------------------
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7893 int stru319::FindClosestActor(int pick_depth, int a3, int a4)
0
Ritor1
parents:
diff changeset
7894 {
Ritor1
parents:
diff changeset
7895 int v4; // edi@1
Ritor1
parents:
diff changeset
7896 stru319 *v5; // esi@1
Ritor1
parents:
diff changeset
7897 int v6; // eax@2
Ritor1
parents:
diff changeset
7898 int v7; // eax@4
Ritor1
parents:
diff changeset
7899 int result; // eax@5
Ritor1
parents:
diff changeset
7900 int *v9; // edx@8
Ritor1
parents:
diff changeset
7901 signed int v10; // ebx@10
Ritor1
parents:
diff changeset
7902 int v11; // edi@11
Ritor1
parents:
diff changeset
7903 Actor *v12; // esi@12
Ritor1
parents:
diff changeset
7904 unsigned __int16 v13; // ax@12
Ritor1
parents:
diff changeset
7905 int v14; // eax@22
Ritor1
parents:
diff changeset
7906 char v15; // zf@30
Ritor1
parents:
diff changeset
7907 int v16; // esi@32
Ritor1
parents:
diff changeset
7908 int v17; // ecx@34
Ritor1
parents:
diff changeset
7909 stru319 *v18; // eax@39
Ritor1
parents:
diff changeset
7910 int v19; // edx@39
Ritor1
parents:
diff changeset
7911 int v20; // ecx@41
Ritor1
parents:
diff changeset
7912 unsigned __int16 v21; // ax@42
Ritor1
parents:
diff changeset
7913 unsigned int v22; // [sp+8h] [bp-24h]@11
Ritor1
parents:
diff changeset
7914 unsigned int v23; // [sp+Ch] [bp-20h]@7
Ritor1
parents:
diff changeset
7915 stru319 *v24; // [sp+10h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
7916 unsigned int v25; // [sp+14h] [bp-18h]@8
Ritor1
parents:
diff changeset
7917 int *v26; // [sp+18h] [bp-14h]@8
Ritor1
parents:
diff changeset
7918 int v27; // [sp+1Ch] [bp-10h]@10
Ritor1
parents:
diff changeset
7919 int *v28; // [sp+20h] [bp-Ch]@10
Ritor1
parents:
diff changeset
7920 unsigned int v29; // [sp+24h] [bp-8h]@7
Ritor1
parents:
diff changeset
7921 int v30; // [sp+28h] [bp-4h]@6
Ritor1
parents:
diff changeset
7922 int i; // [sp+38h] [bp+Ch]@33
Ritor1
parents:
diff changeset
7923 signed int v32; // [sp+3Ch] [bp+10h]@32
Ritor1
parents:
diff changeset
7924
Ritor1
parents:
diff changeset
7925 v4 = 0;
Ritor1
parents:
diff changeset
7926 v5 = this;
Ritor1
parents:
diff changeset
7927 v24 = this;
Ritor1
parents:
diff changeset
7928 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
7929 {
Ritor1
parents:
diff changeset
7930 v6 = a3 != 0;
Ritor1
parents:
diff changeset
7931 if ( a4 )
Ritor1
parents:
diff changeset
7932 LOBYTE(v6) = v6 | 8;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7933 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1);
0
Ritor1
parents:
diff changeset
7934 if ( v7 != -1 )
Ritor1
parents:
diff changeset
7935 return (unsigned __int16)v7;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7936 else return 0;
0
Ritor1
parents:
diff changeset
7937 }
Ritor1
parents:
diff changeset
7938 else
Ritor1
parents:
diff changeset
7939 {
Ritor1
parents:
diff changeset
7940 v30 = 0;
Ritor1
parents:
diff changeset
7941 if ( pRenderer->pActiveZBuffer )
Ritor1
parents:
diff changeset
7942 {
692
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7943 v29 = viewparams->uScreen_topL_X;
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7944 v23 = viewparams->uScreen_BttmR_X;
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7945 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y )
0
Ritor1
parents:
diff changeset
7946 {
692
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7947 v25 = viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y;
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7948 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y];
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
7949 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y];
0
Ritor1
parents:
diff changeset
7950 do
Ritor1
parents:
diff changeset
7951 {
Ritor1
parents:
diff changeset
7952 if ( (signed int)v29 < (signed int)v23 )
Ritor1
parents:
diff changeset
7953 {
Ritor1
parents:
diff changeset
7954 v28 = v9;
Ritor1
parents:
diff changeset
7955 v10 = v4;
Ritor1
parents:
diff changeset
7956 v27 = v23 - v29;
Ritor1
parents:
diff changeset
7957 do
Ritor1
parents:
diff changeset
7958 {
Ritor1
parents:
diff changeset
7959 v22 = *v28;
Ritor1
parents:
diff changeset
7960 v11 = *v28 & 0xFFFF;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
7961 if (PID_TYPE(v11) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
7962 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
7963 v12 = &pActors[PID_ID(v11)];
0
Ritor1
parents:
diff changeset
7964 v13 = v12->uAIState;
Ritor1
parents:
diff changeset
7965 if ( v13 != 5 )
Ritor1
parents:
diff changeset
7966 {
Ritor1
parents:
diff changeset
7967 if ( v13 != 4
Ritor1
parents:
diff changeset
7968 && v13 != 11
Ritor1
parents:
diff changeset
7969 && v13 != 19
Ritor1
parents:
diff changeset
7970 && v13 != 17
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
7971 && (!a3 || pActors[PID_ID(v11)].GetActorsRelation(0)) )
0
Ritor1
parents:
diff changeset
7972 {
Ritor1
parents:
diff changeset
7973 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7974 && v22 <= pick_depth << 16 )
0
Ritor1
parents:
diff changeset
7975 {
Ritor1
parents:
diff changeset
7976 v14 = 0;
Ritor1
parents:
diff changeset
7977 if ( v10 > 0 )
Ritor1
parents:
diff changeset
7978 {
Ritor1
parents:
diff changeset
7979 do
Ritor1
parents:
diff changeset
7980 {
Ritor1
parents:
diff changeset
7981 if ( dword_50BDA0[v14] == v11 )
Ritor1
parents:
diff changeset
7982 break;
Ritor1
parents:
diff changeset
7983 ++v14;
Ritor1
parents:
diff changeset
7984 }
Ritor1
parents:
diff changeset
7985 while ( v14 < v30 );
Ritor1
parents:
diff changeset
7986 }
Ritor1
parents:
diff changeset
7987 if ( v14 == v30 && v10 < 100 )
Ritor1
parents:
diff changeset
7988 {
Ritor1
parents:
diff changeset
7989 ++v30;
Ritor1
parents:
diff changeset
7990 dword_50BC10[v10] = v22;
Ritor1
parents:
diff changeset
7991 dword_50BDA0[v10] = v11;
Ritor1
parents:
diff changeset
7992 ++v10;
Ritor1
parents:
diff changeset
7993 }
Ritor1
parents:
diff changeset
7994 }
Ritor1
parents:
diff changeset
7995 }
Ritor1
parents:
diff changeset
7996 }
Ritor1
parents:
diff changeset
7997 }
Ritor1
parents:
diff changeset
7998 ++v28;
Ritor1
parents:
diff changeset
7999 --v27;
Ritor1
parents:
diff changeset
8000 }
Ritor1
parents:
diff changeset
8001 while ( v27 );
Ritor1
parents:
diff changeset
8002 v4 = v30;
Ritor1
parents:
diff changeset
8003 v5 = v24;
Ritor1
parents:
diff changeset
8004 }
Ritor1
parents:
diff changeset
8005 v9 = v26 + 640;
Ritor1
parents:
diff changeset
8006 v15 = v25-- == 1;
Ritor1
parents:
diff changeset
8007 v26 += 640;
Ritor1
parents:
diff changeset
8008 }
Ritor1
parents:
diff changeset
8009 while ( !v15 );
Ritor1
parents:
diff changeset
8010 }
Ritor1
parents:
diff changeset
8011 if ( v4 > 0 )
Ritor1
parents:
diff changeset
8012 {
Ritor1
parents:
diff changeset
8013 v32 = 1;
Ritor1
parents:
diff changeset
8014 v16 = (int)dword_50BC10;
Ritor1
parents:
diff changeset
8015 do
Ritor1
parents:
diff changeset
8016 {
Ritor1
parents:
diff changeset
8017 for ( i = v32; i < v4; ++i )
Ritor1
parents:
diff changeset
8018 {
Ritor1
parents:
diff changeset
8019 v17 = dword_50BC10[i];
Ritor1
parents:
diff changeset
8020 if ( v17 < *(int *)v16 )
Ritor1
parents:
diff changeset
8021 {
Ritor1
parents:
diff changeset
8022 dword_50BC10[i] = *(int *)v16;
Ritor1
parents:
diff changeset
8023 *(int *)v16 = v17;
Ritor1
parents:
diff changeset
8024 }
Ritor1
parents:
diff changeset
8025 }
Ritor1
parents:
diff changeset
8026 ++v32;
Ritor1
parents:
diff changeset
8027 v16 += 4;
Ritor1
parents:
diff changeset
8028 }
Ritor1
parents:
diff changeset
8029 while ( v32 - 1 < v4 );
Ritor1
parents:
diff changeset
8030 v5 = v24;
Ritor1
parents:
diff changeset
8031 if ( v4 > 0 )
Ritor1
parents:
diff changeset
8032 {
Ritor1
parents:
diff changeset
8033 v18 = v24;
Ritor1
parents:
diff changeset
8034 v19 = v4;
Ritor1
parents:
diff changeset
8035 do
Ritor1
parents:
diff changeset
8036 {
Ritor1
parents:
diff changeset
8037 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF;
Ritor1
parents:
diff changeset
8038 v18 += 4;
Ritor1
parents:
diff changeset
8039 --v19;
Ritor1
parents:
diff changeset
8040 }
Ritor1
parents:
diff changeset
8041 while ( v19 );
Ritor1
parents:
diff changeset
8042 }
Ritor1
parents:
diff changeset
8043 }
Ritor1
parents:
diff changeset
8044 v20 = 0;
Ritor1
parents:
diff changeset
8045 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 )
Ritor1
parents:
diff changeset
8046 {
Ritor1
parents:
diff changeset
8047 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState;
Ritor1
parents:
diff changeset
8048 if ( v21 != 4 && v21 != 5 )
Ritor1
parents:
diff changeset
8049 break;
Ritor1
parents:
diff changeset
8050 }
Ritor1
parents:
diff changeset
8051 if ( v20 != v4 )
Ritor1
parents:
diff changeset
8052 {
Ritor1
parents:
diff changeset
8053 result = 8 * *(int *)&v5[4 * v20].field_0;
Ritor1
parents:
diff changeset
8054 LOBYTE(result) = result | 3;
Ritor1
parents:
diff changeset
8055 return result;
Ritor1
parents:
diff changeset
8056 }
Ritor1
parents:
diff changeset
8057 }
Ritor1
parents:
diff changeset
8058 }
Ritor1
parents:
diff changeset
8059 return 0;
Ritor1
parents:
diff changeset
8060 }
Ritor1
parents:
diff changeset
8061
Ritor1
parents:
diff changeset
8062 //----- (0042F3D6) --------------------------------------------------------
Ritor1
parents:
diff changeset
8063 void InitializeTurnBasedAnimations(void *_this)
Ritor1
parents:
diff changeset
8064 {
Ritor1
parents:
diff changeset
8065 unsigned int *v1; // edi@1
Ritor1
parents:
diff changeset
8066
Ritor1
parents:
diff changeset
8067 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0");
Ritor1
parents:
diff changeset
8068 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1");
Ritor1
parents:
diff changeset
8069 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2");
Ritor1
parents:
diff changeset
8070 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3");
Ritor1
parents:
diff changeset
8071 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4");
Ritor1
parents:
diff changeset
8072 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
Ritor1
parents:
diff changeset
8073 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
Ritor1
parents:
diff changeset
8074 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
Ritor1
parents:
diff changeset
8075 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
Ritor1
parents:
diff changeset
8076 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
Ritor1
parents:
diff changeset
8077 v1 = pIconIDs_Turn;
Ritor1
parents:
diff changeset
8078 do
Ritor1
parents:
diff changeset
8079 {
Ritor1
parents:
diff changeset
8080 pIconsFrameTable->InitializeAnimation(*v1);
Ritor1
parents:
diff changeset
8081 ++v1;
Ritor1
parents:
diff changeset
8082 }
Ritor1
parents:
diff changeset
8083 while ( (signed int)v1 < (signed int)&uIconID_TurnStop );
Ritor1
parents:
diff changeset
8084 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
Ritor1
parents:
diff changeset
8085 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
Ritor1
parents:
diff changeset
8086 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
Ritor1
parents:
diff changeset
8087 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
Ritor1
parents:
diff changeset
8088 }
Ritor1
parents:
diff changeset
8089
Ritor1
parents:
diff changeset
8090 //----- (0042F4DA) --------------------------------------------------------
Ritor1
parents:
diff changeset
8091 signed int __cdecl sub_42F4DA()
Ritor1
parents:
diff changeset
8092 {
Ritor1
parents:
diff changeset
8093 signed int v0; // edi@1
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8094 Actor *v1; // esi@4
0
Ritor1
parents:
diff changeset
8095 int v2; // ebx@5
Ritor1
parents:
diff changeset
8096 int v3; // eax@5
Ritor1
parents:
diff changeset
8097 int v4; // ebx@5
Ritor1
parents:
diff changeset
8098 unsigned int v5; // ecx@5
Ritor1
parents:
diff changeset
8099 int v6; // edx@6
Ritor1
parents:
diff changeset
8100 unsigned int v7; // edx@8
Ritor1
parents:
diff changeset
8101 unsigned int v8; // edx@10
Ritor1
parents:
diff changeset
8102 __int16 v9; // ax@12
Ritor1
parents:
diff changeset
8103 signed int result; // eax@20
Ritor1
parents:
diff changeset
8104 int v11; // [sp+Ch] [bp-10h]@5
Ritor1
parents:
diff changeset
8105 int v12; // [sp+10h] [bp-Ch]@5
Ritor1
parents:
diff changeset
8106 signed int v13; // [sp+14h] [bp-8h]@3
Ritor1
parents:
diff changeset
8107
Ritor1
parents:
diff changeset
8108 v0 = 5120;
Ritor1
parents:
diff changeset
8109 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
8110 v0 = 2560;
Ritor1
parents:
diff changeset
8111 v13 = 0;
Ritor1
parents:
diff changeset
8112 if ( (signed int)uNumActors <= 0 )
Ritor1
parents:
diff changeset
8113 {
Ritor1
parents:
diff changeset
8114 LABEL_20:
Ritor1
parents:
diff changeset
8115 result = 0;
Ritor1
parents:
diff changeset
8116 }
Ritor1
parents:
diff changeset
8117 else
Ritor1
parents:
diff changeset
8118 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8119 v1 = pActors;
0
Ritor1
parents:
diff changeset
8120 while ( 1 )
Ritor1
parents:
diff changeset
8121 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8122 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x);
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8123 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y);
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8124 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z);
0
Ritor1
parents:
diff changeset
8125 v3 = v2;
Ritor1
parents:
diff changeset
8126 v4 = v11;
Ritor1
parents:
diff changeset
8127 v5 = v12;
Ritor1
parents:
diff changeset
8128 if ( v3 < v11 )
Ritor1
parents:
diff changeset
8129 {
Ritor1
parents:
diff changeset
8130 v6 = v3;
Ritor1
parents:
diff changeset
8131 v3 = v11;
Ritor1
parents:
diff changeset
8132 v4 = v6;
Ritor1
parents:
diff changeset
8133 }
Ritor1
parents:
diff changeset
8134 if ( v3 < v12 )
Ritor1
parents:
diff changeset
8135 {
Ritor1
parents:
diff changeset
8136 v7 = v3;
Ritor1
parents:
diff changeset
8137 v3 = v12;
Ritor1
parents:
diff changeset
8138 v5 = v7;
Ritor1
parents:
diff changeset
8139 }
Ritor1
parents:
diff changeset
8140 if ( v4 < (signed int)v5 )
Ritor1
parents:
diff changeset
8141 {
Ritor1
parents:
diff changeset
8142 v8 = v5;
Ritor1
parents:
diff changeset
8143 v5 = v4;
Ritor1
parents:
diff changeset
8144 v4 = v8;
Ritor1
parents:
diff changeset
8145 }
Ritor1
parents:
diff changeset
8146 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 )
Ritor1
parents:
diff changeset
8147 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8148 v9 = v1->uAIState;
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8149 if ( v1->uAIState != 5 )
0
Ritor1
parents:
diff changeset
8150 {
Ritor1
parents:
diff changeset
8151 if ( v9 != 4
Ritor1
parents:
diff changeset
8152 && v9 != 11
Ritor1
parents:
diff changeset
8153 && v9 != 19
Ritor1
parents:
diff changeset
8154 && v9 != 17
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8155 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) )
0
Ritor1
parents:
diff changeset
8156 break;
Ritor1
parents:
diff changeset
8157 }
Ritor1
parents:
diff changeset
8158 }
Ritor1
parents:
diff changeset
8159 ++v13;
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8160 ++v1;
0
Ritor1
parents:
diff changeset
8161 if ( v13 >= (signed int)uNumActors )
Ritor1
parents:
diff changeset
8162 goto LABEL_20;
Ritor1
parents:
diff changeset
8163 }
Ritor1
parents:
diff changeset
8164 result = 1;
Ritor1
parents:
diff changeset
8165 }
Ritor1
parents:
diff changeset
8166 return result;
Ritor1
parents:
diff changeset
8167 }
Ritor1
parents:
diff changeset
8168
Ritor1
parents:
diff changeset
8169 //----- (0042F7EB) --------------------------------------------------------
Ritor1
parents:
diff changeset
8170 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
8171 {
Ritor1
parents:
diff changeset
8172 unsigned int v9; // edi@1
Ritor1
parents:
diff changeset
8173 signed int v10; // edx@3
Ritor1
parents:
diff changeset
8174 char *v11; // ecx@4
Ritor1
parents:
diff changeset
8175 unsigned __int16 v12; // ax@7
Ritor1
parents:
diff changeset
8176 unsigned int v13; // edx@9
Ritor1
parents:
diff changeset
8177 char *v14; // ecx@10
Ritor1
parents:
diff changeset
8178 int v15; // esi@17
Ritor1
parents:
diff changeset
8179 int v16; // eax@18
Ritor1
parents:
diff changeset
8180 int v17; // edi@20
Ritor1
parents:
diff changeset
8181 int v18; // esi@20
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8182 //SpriteObject a1a; // [sp+Ch] [bp-78h]@1
0
Ritor1
parents:
diff changeset
8183 int v21; // [sp+7Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
8184 unsigned int v22; // [sp+80h] [bp-4h]@1
Ritor1
parents:
diff changeset
8185
Ritor1
parents:
diff changeset
8186 v9 = uSpriteID;
Ritor1
parents:
diff changeset
8187 v21 = x;
Ritor1
parents:
diff changeset
8188 v22 = uSpriteID;
Ritor1
parents:
diff changeset
8189
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8190 SpriteObject a1a; // [sp+Ch] [bp-78h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8191 //SpriteObject::SpriteObject(&a1a);
0
Ritor1
parents:
diff changeset
8192 a1a.stru_24.Reset();
Ritor1
parents:
diff changeset
8193
Ritor1
parents:
diff changeset
8194 if ( a9 )
Ritor1
parents:
diff changeset
8195 {
Ritor1
parents:
diff changeset
8196 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24));
Ritor1
parents:
diff changeset
8197 v9 = v22;
Ritor1
parents:
diff changeset
8198 }
Ritor1
parents:
diff changeset
8199 v10 = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8200 a1a.spell_skill = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8201 a1a.spell_level = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8202 a1a.spell_id = 0;
0
Ritor1
parents:
diff changeset
8203 a1a.field_54 = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8204 a1a.uType = v9;
0
Ritor1
parents:
diff changeset
8205 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8206 {
Ritor1
parents:
diff changeset
8207 LABEL_7:
Ritor1
parents:
diff changeset
8208 v12 = 0;
Ritor1
parents:
diff changeset
8209 }
Ritor1
parents:
diff changeset
8210 else
Ritor1
parents:
diff changeset
8211 {
Ritor1
parents:
diff changeset
8212 v11 = (char *)&pObjectList->pObjects->uObjectID;
Ritor1
parents:
diff changeset
8213 while ( (short)v9 != *(short *)v11 )
Ritor1
parents:
diff changeset
8214 {
Ritor1
parents:
diff changeset
8215 ++v10;
Ritor1
parents:
diff changeset
8216 v11 += 56;
Ritor1
parents:
diff changeset
8217 if ( v10 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8218 goto LABEL_7;
Ritor1
parents:
diff changeset
8219 }
Ritor1
parents:
diff changeset
8220 v12 = v10;
Ritor1
parents:
diff changeset
8221 }
Ritor1
parents:
diff changeset
8222 a1a.uObjectDescID = v12;
Ritor1
parents:
diff changeset
8223 a1a.vPosition.z = z;
Ritor1
parents:
diff changeset
8224 a1a.vPosition.x = v21;
Ritor1
parents:
diff changeset
8225 a1a.vPosition.y = y;
Ritor1
parents:
diff changeset
8226 a1a.uSoundID = 0;
Ritor1
parents:
diff changeset
8227 a1a.uAttributes = attributes;
Ritor1
parents:
diff changeset
8228 a1a.uSectorID = pIndoor->GetSector(v21, y, z);
Ritor1
parents:
diff changeset
8229 a1a.uSpriteFrameID = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8230 a1a.spell_caster_pid = 0;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
8231 a1a.spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
8232 if ( !(a1a.uAttributes & 0x10) )
Ritor1
parents:
diff changeset
8233 {
Ritor1
parents:
diff changeset
8234 v13 = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
8235 if ( (signed int)pItemsTable->uAllItemsCount > 0 )
0
Ritor1
parents:
diff changeset
8236 {
Ritor1
parents:
diff changeset
8237 v14 = (char *)&pItemsTable->pItems[0].uSpriteID;
Ritor1
parents:
diff changeset
8238 while ( *(short *)v14 != v9 )
Ritor1
parents:
diff changeset
8239 {
Ritor1
parents:
diff changeset
8240 ++v13;
Ritor1
parents:
diff changeset
8241 v14 += 48;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
8242 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount )
0
Ritor1
parents:
diff changeset
8243 goto LABEL_16;
Ritor1
parents:
diff changeset
8244 }
Ritor1
parents:
diff changeset
8245 a1a.stru_24.uItemID = v13;
Ritor1
parents:
diff changeset
8246 }
Ritor1
parents:
diff changeset
8247 }
Ritor1
parents:
diff changeset
8248 LABEL_16:
Ritor1
parents:
diff changeset
8249 if ( a7 )
Ritor1
parents:
diff changeset
8250 {
Ritor1
parents:
diff changeset
8251 v15 = count;
Ritor1
parents:
diff changeset
8252 if ( count > 0 )
Ritor1
parents:
diff changeset
8253 {
Ritor1
parents:
diff changeset
8254 do
Ritor1
parents:
diff changeset
8255 {
Ritor1
parents:
diff changeset
8256 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
Ritor1
parents:
diff changeset
8257 v16 = rand();
Ritor1
parents:
diff changeset
8258 a1a.Create(
Ritor1
parents:
diff changeset
8259 (signed __int16)a1a.uFacing,
Ritor1
parents:
diff changeset
8260 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1),
Ritor1
parents:
diff changeset
8261 a4,
Ritor1
parents:
diff changeset
8262 0);
Ritor1
parents:
diff changeset
8263 --v15;
Ritor1
parents:
diff changeset
8264 }
Ritor1
parents:
diff changeset
8265 while ( v15 );
Ritor1
parents:
diff changeset
8266 }
Ritor1
parents:
diff changeset
8267 }
Ritor1
parents:
diff changeset
8268 else
Ritor1
parents:
diff changeset
8269 {
Ritor1
parents:
diff changeset
8270 v17 = count;
Ritor1
parents:
diff changeset
8271 v18 = stru_5C6E00->uIntegerHalfPi;
Ritor1
parents:
diff changeset
8272 a1a.uFacing = 0;
Ritor1
parents:
diff changeset
8273 if ( count > 0 )
Ritor1
parents:
diff changeset
8274 {
Ritor1
parents:
diff changeset
8275 do
Ritor1
parents:
diff changeset
8276 {
Ritor1
parents:
diff changeset
8277 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0);
Ritor1
parents:
diff changeset
8278 --v17;
Ritor1
parents:
diff changeset
8279 }
Ritor1
parents:
diff changeset
8280 while ( v17 );
Ritor1
parents:
diff changeset
8281 }
Ritor1
parents:
diff changeset
8282 }
Ritor1
parents:
diff changeset
8283 return 1;
Ritor1
parents:
diff changeset
8284 }
Ritor1
parents:
diff changeset
8285
Ritor1
parents:
diff changeset
8286 //----- (0042F960) --------------------------------------------------------
Ritor1
parents:
diff changeset
8287 void __fastcall sub_42F960_create_object(int x, int y, int z)
Ritor1
parents:
diff changeset
8288 {
Ritor1
parents:
diff changeset
8289 int v3; // ebx@1
Ritor1
parents:
diff changeset
8290 int v4; // edi@1
Ritor1
parents:
diff changeset
8291 signed int v5; // edx@1
Ritor1
parents:
diff changeset
8292 char *v6; // ecx@2
Ritor1
parents:
diff changeset
8293 unsigned __int16 v7; // ax@5
Ritor1
parents:
diff changeset
8294 signed int v8; // eax@6
Ritor1
parents:
diff changeset
8295 signed int v9; // eax@7
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8296 //SpriteObject a1; // [sp+Ch] [bp-70h]@1
0
Ritor1
parents:
diff changeset
8297
Ritor1
parents:
diff changeset
8298 v3 = x;
Ritor1
parents:
diff changeset
8299 v4 = y;
Ritor1
parents:
diff changeset
8300
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8301 SpriteObject a1; // [sp+Ch] [bp-70h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8302 //SpriteObject::SpriteObject(&a1);
0
Ritor1
parents:
diff changeset
8303 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
8304
Ritor1
parents:
diff changeset
8305 v5 = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8306 a1.spell_skill = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8307 a1.spell_level = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8308 a1.spell_id = 0;
0
Ritor1
parents:
diff changeset
8309 a1.field_54 = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8310 a1.uType = 800;
0
Ritor1
parents:
diff changeset
8311 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8312 {
Ritor1
parents:
diff changeset
8313 LABEL_5:
Ritor1
parents:
diff changeset
8314 v7 = 0;
Ritor1
parents:
diff changeset
8315 }
Ritor1
parents:
diff changeset
8316 else
Ritor1
parents:
diff changeset
8317 {
Ritor1
parents:
diff changeset
8318 v6 = (char *)&pObjectList->pObjects->uObjectID;
Ritor1
parents:
diff changeset
8319 while ( *(short *)v6 != 800 )
Ritor1
parents:
diff changeset
8320 {
Ritor1
parents:
diff changeset
8321 ++v5;
Ritor1
parents:
diff changeset
8322 v6 += 56;
Ritor1
parents:
diff changeset
8323 if ( v5 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8324 goto LABEL_5;
Ritor1
parents:
diff changeset
8325 }
Ritor1
parents:
diff changeset
8326 v7 = v5;
Ritor1
parents:
diff changeset
8327 }
Ritor1
parents:
diff changeset
8328 a1.uObjectDescID = v7;
Ritor1
parents:
diff changeset
8329 a1.vPosition.x = v3;
Ritor1
parents:
diff changeset
8330 a1.vPosition.y = v4;
Ritor1
parents:
diff changeset
8331 a1.vPosition.z = z;
Ritor1
parents:
diff changeset
8332 a1.uSoundID = 0;
Ritor1
parents:
diff changeset
8333 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
8334 a1.uSectorID = pIndoor->GetSector(v3, v4, z);
Ritor1
parents:
diff changeset
8335 a1.uSpriteFrameID = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8336 a1.spell_caster_pid = 0;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
8337 a1.spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
8338 v8 = a1.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
8339 if ( v8 != -1 )
Ritor1
parents:
diff changeset
8340 {
Ritor1
parents:
diff changeset
8341 v9 = 8 * v8;
Ritor1
parents:
diff changeset
8342 LOBYTE(v9) = v9 | 2;
Ritor1
parents:
diff changeset
8343 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
8344 }
Ritor1
parents:
diff changeset
8345 }
Ritor1
parents:
diff changeset
8346
810
f5156b8c61ad savegame refactoring
Gloval
parents: 792
diff changeset
8347
0
Ritor1
parents:
diff changeset
8348
Ritor1
parents:
diff changeset
8349 //----- (0042FA66) --------------------------------------------------------
Ritor1
parents:
diff changeset
8350 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6)
Ritor1
parents:
diff changeset
8351 {
Ritor1
parents:
diff changeset
8352 int v6; // edi@1
Ritor1
parents:
diff changeset
8353 int v7; // esi@1
Ritor1
parents:
diff changeset
8354 char *v8; // ecx@2
Ritor1
parents:
diff changeset
8355 unsigned __int16 v9; // ax@5
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8356 //int v10; // eax@10
0
Ritor1
parents:
diff changeset
8357 signed int result; // eax@11
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8358 //__int16 v12; // ax@12
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8359 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1
0
Ritor1
parents:
diff changeset
8360 int v14; // [sp+7Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
8361
Ritor1
parents:
diff changeset
8362 v6 = a1;
Ritor1
parents:
diff changeset
8363 v7 = a2;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8364 SpriteObject a1a; // [sp+Ch] [bp-74h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8365 //SpriteObject::SpriteObject(&a1a);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8366 a1a.uType = 600;
0
Ritor1
parents:
diff changeset
8367 a1a.stru_24.Reset();
Ritor1
parents:
diff changeset
8368
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8369 a1a.spell_id = SPELL_FIRE_FIREBALL;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8370 a1a.spell_level = 8;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8371 a1a.spell_skill = 3;
0
Ritor1
parents:
diff changeset
8372 v14 = 0;
Ritor1
parents:
diff changeset
8373 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8374 {
Ritor1
parents:
diff changeset
8375 LABEL_5:
Ritor1
parents:
diff changeset
8376 v9 = 0;
Ritor1
parents:
diff changeset
8377 }
Ritor1
parents:
diff changeset
8378 else
Ritor1
parents:
diff changeset
8379 {
Ritor1
parents:
diff changeset
8380 v8 = (char *)&pObjectList->pObjects->uObjectID;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
8381 while ( (short)a1a.uType != *(short *)v8 )
0
Ritor1
parents:
diff changeset
8382 {
Ritor1
parents:
diff changeset
8383 ++v14;
Ritor1
parents:
diff changeset
8384 v8 += 56;
Ritor1
parents:
diff changeset
8385 if ( v14 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8386 goto LABEL_5;
Ritor1
parents:
diff changeset
8387 }
Ritor1
parents:
diff changeset
8388 v9 = v14;
Ritor1
parents:
diff changeset
8389 }
Ritor1
parents:
diff changeset
8390 a1a.uObjectDescID = v9;
Ritor1
parents:
diff changeset
8391 a1a.vPosition.x = v6;
Ritor1
parents:
diff changeset
8392 a1a.vPosition.y = v7;
Ritor1
parents:
diff changeset
8393 a1a.vPosition.z = a3;
Ritor1
parents:
diff changeset
8394 a1a.uAttributes = 0;
Ritor1
parents:
diff changeset
8395 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3);
Ritor1
parents:
diff changeset
8396 a1a.uSpriteFrameID = 0;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
8397 a1a.spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
8398 a1a.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
8399 a1a.uFacing = 0;
Ritor1
parents:
diff changeset
8400 a1a.uSoundID = 0;
Ritor1
parents:
diff changeset
8401 if ( a6 >= 1 || a6 <= 4 )
Ritor1
parents:
diff changeset
8402 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8403 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1);
0
Ritor1
parents:
diff changeset
8404 }
Ritor1
parents:
diff changeset
8405 else
Ritor1
parents:
diff changeset
8406 {
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
8407 a1a.spell_caster_pid = 0;
0
Ritor1
parents:
diff changeset
8408 }
Ritor1
parents:
diff changeset
8409 result = a1a.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
8410 if ( result != -1 )
Ritor1
parents:
diff changeset
8411 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8412 result = stru_50FE08.Add(PID(OBJECT_Item, result),
0
Ritor1
parents:
diff changeset
8413 a5,
Ritor1
parents:
diff changeset
8414 SLOWORD(a1a.vPosition.x),
Ritor1
parents:
diff changeset
8415 SLOWORD(a1a.vPosition.y),
Ritor1
parents:
diff changeset
8416 SLOWORD(a1a.vPosition.z),
Ritor1
parents:
diff changeset
8417 0,
Ritor1
parents:
diff changeset
8418 0);
Ritor1
parents:
diff changeset
8419 }
Ritor1
parents:
diff changeset
8420 return result;
Ritor1
parents:
diff changeset
8421 }
Ritor1
parents:
diff changeset
8422
Ritor1
parents:
diff changeset
8423 //----- (0042FB5C) --------------------------------------------------------
Ritor1
parents:
diff changeset
8424 bool __fastcall sub_42FB5C(signed int a1)
Ritor1
parents:
diff changeset
8425 {
Ritor1
parents:
diff changeset
8426 int v1; // ecx@3
Ritor1
parents:
diff changeset
8427 int v2; // ecx@4
Ritor1
parents:
diff changeset
8428 int v3; // ecx@5
Ritor1
parents:
diff changeset
8429 int v4; // ecx@6
Ritor1
parents:
diff changeset
8430 int v5; // ecx@7
Ritor1
parents:
diff changeset
8431 int v6; // ecx@8
Ritor1
parents:
diff changeset
8432 char v7; // zf@9
Ritor1
parents:
diff changeset
8433
Ritor1
parents:
diff changeset
8434 if ( a1 > 39 )
Ritor1
parents:
diff changeset
8435 {
Ritor1
parents:
diff changeset
8436 if ( a1 > 77 )
Ritor1
parents:
diff changeset
8437 {
Ritor1
parents:
diff changeset
8438 if ( a1 == 80 )
Ritor1
parents:
diff changeset
8439 return 0;
Ritor1
parents:
diff changeset
8440 if ( a1 > 84 )
Ritor1
parents:
diff changeset
8441 {
Ritor1
parents:
diff changeset
8442 if ( a1 <= 86 )
Ritor1
parents:
diff changeset
8443 return 0;
Ritor1
parents:
diff changeset
8444 v7 = a1 == 95;
Ritor1
parents:
diff changeset
8445 goto LABEL_20;
Ritor1
parents:
diff changeset
8446 }
Ritor1
parents:
diff changeset
8447 }
Ritor1
parents:
diff changeset
8448 else
Ritor1
parents:
diff changeset
8449 {
Ritor1
parents:
diff changeset
8450 if ( a1 == 77 )
Ritor1
parents:
diff changeset
8451 return 0;
Ritor1
parents:
diff changeset
8452 if ( a1 >= 46 )
Ritor1
parents:
diff changeset
8453 {
Ritor1
parents:
diff changeset
8454 if ( a1 <= 47 || a1 == 51 )
Ritor1
parents:
diff changeset
8455 return 0;
Ritor1
parents:
diff changeset
8456 v7 = a1 == 73;
Ritor1
parents:
diff changeset
8457 goto LABEL_20;
Ritor1
parents:
diff changeset
8458 }
Ritor1
parents:
diff changeset
8459 }
Ritor1
parents:
diff changeset
8460 return 1;
Ritor1
parents:
diff changeset
8461 }
Ritor1
parents:
diff changeset
8462 if ( a1 == 39 || (v1 = a1 - 2) == 0 )
Ritor1
parents:
diff changeset
8463 return 1;
Ritor1
parents:
diff changeset
8464 v2 = v1 - 3;
Ritor1
parents:
diff changeset
8465 if ( !v2 )
Ritor1
parents:
diff changeset
8466 return 0;
Ritor1
parents:
diff changeset
8467 v3 = v2 - 1;
Ritor1
parents:
diff changeset
8468 if ( !v3 || (v4 = v3 - 3) == 0 )
Ritor1
parents:
diff changeset
8469 return 1;
Ritor1
parents:
diff changeset
8470 v5 = v4 - 8;
Ritor1
parents:
diff changeset
8471 if ( !v5 )
Ritor1
parents:
diff changeset
8472 return 0;
Ritor1
parents:
diff changeset
8473 v6 = v5 - 1;
Ritor1
parents:
diff changeset
8474 if ( !v6 )
Ritor1
parents:
diff changeset
8475 return 1;
Ritor1
parents:
diff changeset
8476 v7 = v6 == 20;
Ritor1
parents:
diff changeset
8477 LABEL_20:
Ritor1
parents:
diff changeset
8478 if ( !v7 )
Ritor1
parents:
diff changeset
8479 return 1;
Ritor1
parents:
diff changeset
8480 return 0;
Ritor1
parents:
diff changeset
8481 }
Ritor1
parents:
diff changeset
8482
Ritor1
parents:
diff changeset
8483 //----- (0042FBDD) --------------------------------------------------------
Ritor1
parents:
diff changeset
8484 void __cdecl sub_42FBDD()
Ritor1
parents:
diff changeset
8485 {
388
d95a91011d57 AudioPlayer::PlaySound
Nomad
parents: 377
diff changeset
8486 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
8487 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
Ritor1
parents:
diff changeset
8488 pRenderer->Present();
Ritor1
parents:
diff changeset
8489 }
Ritor1
parents:
diff changeset
8490
Ritor1
parents:
diff changeset
8491 //----- (0042FC15) --------------------------------------------------------
11
66319a734368 16.01.13(work)
Ritor1
parents: 0
diff changeset
8492 void __cdecl CloseWindowBackground()
0
Ritor1
parents:
diff changeset
8493 {
388
d95a91011d57 AudioPlayer::PlaySound
Nomad
parents: 377
diff changeset
8494 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
8495 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
Ritor1
parents:
diff changeset
8496 pRenderer->Present();
Ritor1
parents:
diff changeset
8497 }
Ritor1
parents:
diff changeset
8498
Ritor1
parents:
diff changeset
8499 //----- (0042FC4E) --------------------------------------------------------
Ritor1
parents:
diff changeset
8500 void __cdecl ProcessInputActions()
Ritor1
parents:
diff changeset
8501 {
Ritor1
parents:
diff changeset
8502 char v4; // al@9
Ritor1
parents:
diff changeset
8503 char v8; // bl@100
Ritor1
parents:
diff changeset
8504 unsigned __int16 v9; // ax@102
Ritor1
parents:
diff changeset
8505 int v10; // eax@103
Ritor1
parents:
diff changeset
8506 char v14; // al@159
Ritor1
parents:
diff changeset
8507 unsigned int v15; // eax@168
Ritor1
parents:
diff changeset
8508 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
Ritor1
parents:
diff changeset
8509 InputAction inputAction; // [sp+0h] [bp-8h]@7
Ritor1
parents:
diff changeset
8510 int v24; // [sp+4h] [bp-4h]@87
Ritor1
parents:
diff changeset
8511
Ritor1
parents:
diff changeset
8512 pGame->pKeyboardInstance->EnterCriticalSection();
Ritor1
parents:
diff changeset
8513 auto pKeyboard = pGame->pKeyboardInstance;
Ritor1
parents:
diff changeset
8514 if (!bAlwaysRun)
Ritor1
parents:
diff changeset
8515 {
Ritor1
parents:
diff changeset
8516 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
8517 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8518 else
Ritor1
parents:
diff changeset
8519 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8520 }
Ritor1
parents:
diff changeset
8521 else
Ritor1
parents:
diff changeset
8522 {
Ritor1
parents:
diff changeset
8523 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
8524 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8525 else
Ritor1
parents:
diff changeset
8526 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8527 }
Ritor1
parents:
diff changeset
8528
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
8529 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8530 for ( uint i = 0; i < 30; ++i )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8531 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8532 if ( pKeyActionMap->pToggleTypes[i] )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8533 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8534 else
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8535 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8536 if ( v14 && i == 9 )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8537 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8538 if ( !pCurrentScreen )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8539 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8540 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8541 continue;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8542 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8543 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8544 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8545 v15 = pMessageQueue_50CBD0->uNumMessages;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8546 if ( pMessageQueue_50CBD0->uNumMessages )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8547 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8548 v15 = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8549 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8550 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8551 v15 = 1;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8552 pMessageQueue_50CBD0->uNumMessages = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8553 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8554 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8555 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8556 ++pMessageQueue_50CBD0->uNumMessages;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8557 continue;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8558 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8559 pMessageQueue_50CBD0->uNumMessages = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8560 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8561 //pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8562 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8563 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8564 }
0
Ritor1
parents:
diff changeset
8565 if ( !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8566 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8567 for ( uint i = 0; i < 30; ++i )
0
Ritor1
parents:
diff changeset
8568 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8569 inputAction = (InputAction)i;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8570 if ( pKeyActionMap->pToggleTypes[(InputAction)i] )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8571 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]);
0
Ritor1
parents:
diff changeset
8572 else
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8573 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]);
0
Ritor1
parents:
diff changeset
8574 if ( v4 )
Ritor1
parents:
diff changeset
8575 {
Ritor1
parents:
diff changeset
8576 switch ( inputAction )
Ritor1
parents:
diff changeset
8577 {
Ritor1
parents:
diff changeset
8578 case INPUT_MoveForward:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8579 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8580 break;
Ritor1
parents:
diff changeset
8581 if (!pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8582 {
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
8583 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
0
Ritor1
parents:
diff changeset
8584 partyAction = PARTY_RunForward;
Ritor1
parents:
diff changeset
8585 else
Ritor1
parents:
diff changeset
8586 partyAction = PARTY_WalkForward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8587 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8588 break;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8589 }
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8590 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8591 {
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8592 pTurnEngine->uActionPointsLeft -= 26;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8593 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8594 partyAction = PARTY_RunForward;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8595 else
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8596 partyAction = PARTY_WalkForward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8597 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8598 break;
0
Ritor1
parents:
diff changeset
8599 }
Ritor1
parents:
diff changeset
8600 break;
Ritor1
parents:
diff changeset
8601 case INPUT_MoveBackwards:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8602 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8603 break;
Ritor1
parents:
diff changeset
8604 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8605 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8606 if ( pParty->uFlags2 & 2 )
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8607 partyAction = PARTY_RunBackward;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8608 else
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8609 partyAction = PARTY_WalkBackward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8610 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8611 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8612 }
0
Ritor1
parents:
diff changeset
8613 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
Ritor1
parents:
diff changeset
8614 {
Ritor1
parents:
diff changeset
8615 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8616 if ( pParty->uFlags2 & 2 )
Ritor1
parents:
diff changeset
8617 partyAction = PARTY_RunBackward;
Ritor1
parents:
diff changeset
8618 else
Ritor1
parents:
diff changeset
8619 partyAction = PARTY_WalkBackward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8620 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8621 break;
0
Ritor1
parents:
diff changeset
8622 }
Ritor1
parents:
diff changeset
8623 break;
Ritor1
parents:
diff changeset
8624 case INPUT_StrafeLeft:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8625 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8626 break;
Ritor1
parents:
diff changeset
8627 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8628 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8629 partyAction = PARTY_StrafeLeft;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8630 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8631 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8632 }
0
Ritor1
parents:
diff changeset
8633 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8634 break;
Ritor1
parents:
diff changeset
8635 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8636 partyAction = PARTY_StrafeLeft;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8637 pPartyActionQueue->Add(partyAction);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8638 break;
0
Ritor1
parents:
diff changeset
8639 case INPUT_StrafeRight:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8640 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8641 break;
Ritor1
parents:
diff changeset
8642 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8643 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8644 partyAction = PARTY_StrafeRight;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8645 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8646 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8647 }
0
Ritor1
parents:
diff changeset
8648 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8649 break;
Ritor1
parents:
diff changeset
8650 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8651 partyAction = PARTY_StrafeRight;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8652 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8653 break;
0
Ritor1
parents:
diff changeset
8654 case INPUT_TurnLeft:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8655 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8656 break;
Ritor1
parents:
diff changeset
8657 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
Ritor1
parents:
diff changeset
8658 {
Ritor1
parents:
diff changeset
8659 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8660 {
Ritor1
parents:
diff changeset
8661 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8662 break;
Ritor1
parents:
diff changeset
8663 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8664 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8665 partyAction = PARTY_StrafeLeft;
0
Ritor1
parents:
diff changeset
8666 }
Ritor1
parents:
diff changeset
8667 else
Ritor1
parents:
diff changeset
8668 {
Ritor1
parents:
diff changeset
8669 if ( pParty->uFlags2 & 2 )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8670 partyAction = PARTY_FastTurnLeft;
0
Ritor1
parents:
diff changeset
8671 else
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8672 partyAction = PARTY_TurnLeft;
0
Ritor1
parents:
diff changeset
8673 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8674 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
8675 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
Ritor1
parents:
diff changeset
8676 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8677 pWeather->OnPlayerTurn(10);
0
Ritor1
parents:
diff changeset
8678 }
Ritor1
parents:
diff changeset
8679 break;
Ritor1
parents:
diff changeset
8680 case INPUT_TurnRight:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8681 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8682 break;
Ritor1
parents:
diff changeset
8683 if ( GetAsyncKeyState(17) ) // strafing
Ritor1
parents:
diff changeset
8684 {
Ritor1
parents:
diff changeset
8685 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8686 {
Ritor1
parents:
diff changeset
8687 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8688 break;
Ritor1
parents:
diff changeset
8689 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8690 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8691 partyAction = PARTY_StrafeRight;
0
Ritor1
parents:
diff changeset
8692 }
Ritor1
parents:
diff changeset
8693 else
Ritor1
parents:
diff changeset
8694 {
Ritor1
parents:
diff changeset
8695 if ( pParty->uFlags2 & 2 )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8696 partyAction = PARTY_FastTurnRight;
0
Ritor1
parents:
diff changeset
8697 else
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8698 partyAction = PARTY_TurnRight;
0
Ritor1
parents:
diff changeset
8699 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8700 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
8701 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
Ritor1
parents:
diff changeset
8702 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8703 pWeather->OnPlayerTurn(-10);
0
Ritor1
parents:
diff changeset
8704 }
Ritor1
parents:
diff changeset
8705 break;
Ritor1
parents:
diff changeset
8706 case INPUT_Jump:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8707 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn)
0
Ritor1
parents:
diff changeset
8708 break;
Ritor1
parents:
diff changeset
8709 partyAction = (PartyAction)12;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8710 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8711 break;
0
Ritor1
parents:
diff changeset
8712 case INPUT_Yell:
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
8713 if (!pCurrentScreen && uActiveCharacter)
0
Ritor1
parents:
diff changeset
8714 {
Ritor1
parents:
diff changeset
8715 pParty->Yell();
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
8716 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
0
Ritor1
parents:
diff changeset
8717 }
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
8718 break;
0
Ritor1
parents:
diff changeset
8719 case INPUT_Pass:
Ritor1
parents:
diff changeset
8720 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
8721 break;
Ritor1
parents:
diff changeset
8722 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8723 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8724 pTurnEngine->field_18 |= 8u;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8725 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8726 }
0
Ritor1
parents:
diff changeset
8727 if ( uActiveCharacter )
Ritor1
parents:
diff changeset
8728 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8729 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery )
0
Ritor1
parents:
diff changeset
8730 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8731 v24 = pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false);
0
Ritor1
parents:
diff changeset
8732 if ( !pParty->bTurnBasedModeOn )
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8733 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333));
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
8734 pCastSpellInfo->_427D48(uActiveCharacter);
0
Ritor1
parents:
diff changeset
8735 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
8736 }
Ritor1
parents:
diff changeset
8737 }
Ritor1
parents:
diff changeset
8738 break;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8739 case INPUT_Combat://if press ENTER
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8740 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8741 {
Ritor1
parents:
diff changeset
8742 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8743 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
8744 if (pTurnEngine->field_4 == OBJECT_Actor || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
8745 {
Ritor1
parents:
diff changeset
8746 pParty->bTurnBasedModeOn = 0;
Ritor1
parents:
diff changeset
8747 pTurnEngine->End(true);
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 pTurnEngine->Start();
Ritor1
parents:
diff changeset
8753 pParty->bTurnBasedModeOn = true;
Ritor1
parents:
diff changeset
8754 }
Ritor1
parents:
diff changeset
8755 }
Ritor1
parents:
diff changeset
8756 break;
Ritor1
parents:
diff changeset
8757 case INPUT_CastReady:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8758 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8759 break;
Ritor1
parents:
diff changeset
8760 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8761 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8762 pTurnEngine->field_18 |= 8u;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8763 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8764 }
0
Ritor1
parents:
diff changeset
8765 if ( !uActiveCharacter )
Ritor1
parents:
diff changeset
8766 break;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8767 v8 = pPlayers[uActiveCharacter]->uQuickSpell;
0
Ritor1
parents:
diff changeset
8768 if ( !v8
Ritor1
parents:
diff changeset
8769 || bUnderwater
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8770 || ((v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)v8 / 11 + 12], !(HIBYTE(v9) & 1)) ?
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8771 ((v9 & 0x80u) == 0 ? (!(v9 & 0x40) ? (v10 = *(&pSpellDatas[0].uNormalLevelMana + 10 * (unsigned __int8)v8)) :
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8772 (v10 = *(&pSpellDatas[0].uExpertLevelMana + 10 * (unsigned __int8)v8))) :
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8773 (v10 = *(&pSpellDatas[0].uMasterLevelMana + 10 * (unsigned __int8)v8))) :
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8774 (v10 = *(&pSpellDatas[0].uMagisterLevelMana + 10 * (unsigned __int8)v8)),
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8775 v10 > pPlayers[uActiveCharacter]->sMana) )
0
Ritor1
parents:
diff changeset
8776 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8777 pPartyActionQueue = pPartyActionQueue;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8778 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8779 break;
0
Ritor1
parents:
diff changeset
8780 }
Ritor1
parents:
diff changeset
8781 else
Ritor1
parents:
diff changeset
8782 {
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8783 if ( dword_50C9E8 < 40 )
0
Ritor1
parents:
diff changeset
8784 {
Ritor1
parents:
diff changeset
8785 dword_50C9EC[3 * dword_50C9E8] = 25;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8786 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8787 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
0
Ritor1
parents:
diff changeset
8788 ++dword_50C9E8;
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8789 }
0
Ritor1
parents:
diff changeset
8790 }
Ritor1
parents:
diff changeset
8791 break;
Ritor1
parents:
diff changeset
8792 case INPUT_Attack:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8793 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8794 break;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8795 if (pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3)
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8796 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8797 pTurnEngine->field_18 |= 8u;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8798 break;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8799 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8800 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
0
Ritor1
parents:
diff changeset
8801 break;
Ritor1
parents:
diff changeset
8802 case INPUT_EventTrigger:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8803 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8804 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8805 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8806 break;
0
Ritor1
parents:
diff changeset
8807 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
8808 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
0
Ritor1
parents:
diff changeset
8809 {
Ritor1
parents:
diff changeset
8810 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
8811 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8812 pMessageQueue_50CBD0->uNumMessages = 0;
0
Ritor1
parents:
diff changeset
8813 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
Ritor1
parents:
diff changeset
8814 {
Ritor1
parents:
diff changeset
8815 pMessageQueue_50CBD0->uNumMessages = 1;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8816 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0
Ritor1
parents:
diff changeset
8817 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
Ritor1
parents:
diff changeset
8818 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
8819 ++pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
8820 break;
Ritor1
parents:
diff changeset
8821 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8822 break;
0
Ritor1
parents:
diff changeset
8823 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8824 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
0
Ritor1
parents:
diff changeset
8825 }
Ritor1
parents:
diff changeset
8826 break;
Ritor1
parents:
diff changeset
8827 case INPUT_CharCycle:
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8828 if ( pCurrentScreen == SCREEN_SPELL_BOOK || dword_50C9E8 >= 40 )
0
Ritor1
parents:
diff changeset
8829 break;
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8830 dword_50C9EC[3 * dword_50C9E8] = 176;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8831 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8832 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8833 ++dword_50C9E8;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8834 break;
0
Ritor1
parents:
diff changeset
8835 case INPUT_LookUp:
Ritor1
parents:
diff changeset
8836 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8837 break;
Ritor1
parents:
diff changeset
8838 partyAction = (PartyAction)7;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8839 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8840 break;
0
Ritor1
parents:
diff changeset
8841 case INPUT_CenterView:
Ritor1
parents:
diff changeset
8842 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8843 break;
Ritor1
parents:
diff changeset
8844 partyAction = (PartyAction)9;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8845 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8846 break;
0
Ritor1
parents:
diff changeset
8847 case INPUT_LookDown:
Ritor1
parents:
diff changeset
8848 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8849 break;
Ritor1
parents:
diff changeset
8850 partyAction = (PartyAction)8;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8851 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8852 break;
0
Ritor1
parents:
diff changeset
8853 case INPUT_FlyUp:
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8854 if ( pCurrentScreen || pEventTimer->bPaused )
0
Ritor1
parents:
diff changeset
8855 break;
Ritor1
parents:
diff changeset
8856 partyAction = (PartyAction)13;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8857 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8858 break;
0
Ritor1
parents:
diff changeset
8859 case INPUT_Land:
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8860 if ( pCurrentScreen || pEventTimer->bPaused )
0
Ritor1
parents:
diff changeset
8861 break;
Ritor1
parents:
diff changeset
8862 partyAction = (PartyAction)15;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8863 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8864 break;
0
Ritor1
parents:
diff changeset
8865 case INPUT_FlyDown:
Ritor1
parents:
diff changeset
8866 if ( !pCurrentScreen
Ritor1
parents:
diff changeset
8867 && !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8868 {
Ritor1
parents:
diff changeset
8869 partyAction = (PartyAction)14;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8870 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
8871 }
Ritor1
parents:
diff changeset
8872 break;
Ritor1
parents:
diff changeset
8873 case INPUT_ZoomIn:
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8874 if ( dword_50C9E8 >= 40 )
0
Ritor1
parents:
diff changeset
8875 break;
Ritor1
parents:
diff changeset
8876 dword_50C9EC[3 * dword_50C9E8] = 367;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8877 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8878 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8879 ++dword_50C9E8;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8880 break;
0
Ritor1
parents:
diff changeset
8881 case INPUT_ZoomOut:
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8882 if ( dword_50C9E8 < 40 )
0
Ritor1
parents:
diff changeset
8883 {
Ritor1
parents:
diff changeset
8884 dword_50C9EC[3 * dword_50C9E8] = 368;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8885 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
8886 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
0
Ritor1
parents:
diff changeset
8887 ++dword_50C9E8;
1003
9318dd3f3711 return dword_50C9EC
Ritor1
parents: 998
diff changeset
8888 }
0
Ritor1
parents:
diff changeset
8889 break;
Ritor1
parents:
diff changeset
8890 case INPUT_AlwaysRun:
Ritor1
parents:
diff changeset
8891 bAlwaysRun = bAlwaysRun == 0;
Ritor1
parents:
diff changeset
8892 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8893 default:
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8894 break;
0
Ritor1
parents:
diff changeset
8895 }
Ritor1
parents:
diff changeset
8896 }
Ritor1
parents:
diff changeset
8897 }
Ritor1
parents:
diff changeset
8898 }
Ritor1
parents:
diff changeset
8899 if (pGame->pKeyboardInstance->bUsingAsynKeyboard)
Ritor1
parents:
diff changeset
8900 {
Ritor1
parents:
diff changeset
8901 AsyncKeyboard::LeaveCriticalSection();
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8902 //v16 = pAsyncKeyboard;
0
Ritor1
parents:
diff changeset
8903 AsyncKeyboard::EnterCriticalSection();
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
8904 memset((char *)pAsyncKeyboard + 521, 0, 0x100u);
0
Ritor1
parents:
diff changeset
8905 AsyncKeyboard::LeaveCriticalSection();
Ritor1
parents:
diff changeset
8906 }
Ritor1
parents:
diff changeset
8907 }