307
|
1 #include <stdlib.h>
|
|
2
|
|
3 #include "MapInfo.h"
|
|
4 #include "Game.h"
|
|
5 #include "GUIWindow.h"
|
|
6 #include "GUIFont.h"
|
|
7 #include "GUIButton.h"
|
|
8 #include "GUIProgressBar.h"
|
|
9 #include "Chest.h"
|
|
10 #include "stru176.h"
|
|
11 #include "LOD.h"
|
|
12 #include "NPC.h"
|
|
13 #include "Actor.h"
|
|
14 #include "Party.h"
|
|
15 #include "Math.h"
|
|
16 #include "AudioPlayer.h"
|
|
17 #include "Indoor.h"
|
|
18 #include "Viewport.h"
|
|
19 #include "texts.h"
|
|
20 #include "Texture.h"
|
|
21 #include "Allocator.h"
|
|
22 #include "mm7_data.h"
|
|
23 #include "stru123.h"
|
|
24 #include "stru159.h"
|
0
|
25 #include "Events.h"
|
|
26 #include "Events2D.h"
|
307
|
27 #include "Weather.h"
|
0
|
28
|
|
29
|
|
30
|
307
|
31 EventIndex pSomeOtherEVT_Events[4400];
|
0
|
32 unsigned int uSomeOtherEVT_NumEvents;
|
|
33 char *pSomeOtherEVT;
|
307
|
34 EventIndex pSomeEVT_Events[4400];
|
0
|
35 unsigned int uSomeEVT_NumEvents;
|
|
36 char *pSomeEVT;
|
|
37
|
|
38 unsigned int uGlobalEVT_NumEvents;
|
|
39 unsigned int uGlobalEVT_Size;
|
|
40 char pGlobalEVT[46080];
|
307
|
41 EventIndex pGlobalEVT_Index[4400];
|
0
|
42
|
|
43 unsigned int pLevelStrOffsets[500];
|
|
44 unsigned int uLevelStrNumStrings;
|
|
45 unsigned int uLevelStrFileSize;
|
|
46 unsigned int uLevelEVT_NumEvents;
|
|
47 unsigned int uLevelEVT_Size;
|
|
48 char pLevelStr[9216];
|
|
49 char pLevelEVT[9216];
|
307
|
50 EventIndex pLevelEVT_Index[4400];
|
0
|
51
|
|
52
|
|
53 _2devent p2DEvents[525]; // weak
|
307
|
54
|
|
55
|
|
56
|
|
57 //----- (00443CE1) --------------------------------------------------------
|
|
58 unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize)
|
|
59 {
|
|
60 FILE *pLodFile; // eax@1
|
|
61 unsigned int uTextureSize; // esi@3
|
|
62 char Args[60]; // [sp+8h] [bp-B4h]@6
|
|
63 void *ptr; // [sp+B8h] [bp-4h]@1
|
|
64 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
|
|
65
|
|
66 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
|
|
67 pLodFile = pEvents_LOD->FindContainer(pContainerName, 0);
|
|
68 if ( !pLodFile )
|
|
69 Abortf("Unable to load %s", pContainerName);
|
|
70 fread(&DstBuf, 1, 48, pLodFile);
|
|
71 uTextureSize = DstBuf.uDecompressedSize;
|
|
72 if ( !DstBuf.uDecompressedSize )
|
|
73 uTextureSize = DstBuf.uTextureSize;
|
|
74 memset(&DstBuf, 0, 72);
|
|
75 if ( uTextureSize >= (signed int)uBufferSize )
|
|
76 {
|
|
77 sprintf(Args, "File %s Size %lu - Buffer size %lu", pContainerName, uTextureSize, uBufferSize);
|
|
78 Abortf(Args);
|
|
79 }
|
|
80 memcpy(pBuffer, ptr, uTextureSize);
|
|
81 pAllocator->FreeChunk(ptr);
|
|
82 return uTextureSize;
|
|
83 }
|
|
84
|
|
85 //----- (00443DA1) --------------------------------------------------------
|
|
86 void __cdecl Initialize_GlobalEVT()
|
|
87 {
|
|
88 struct raw_event_header
|
|
89 {
|
|
90 unsigned char evt_size;
|
|
91 unsigned char evt_id_l;
|
|
92 unsigned char evt_id_h;
|
|
93 unsigned char evt_sequence_num;
|
|
94 } ;
|
|
95 uint events_count;
|
|
96 unsigned int offset_in;
|
|
97 raw_event_header *current_hdr;
|
|
98 uGlobalEVT_NumEvents = 0;
|
|
99 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 46080);
|
|
100 if ( !uGlobalEVT_Size )
|
|
101 return;
|
|
102 memset(pGlobalEVT_Index, 0x80, sizeof(pGlobalEVT_Index));//52800
|
|
103 events_count = uGlobalEVT_NumEvents;
|
|
104 current_hdr=(raw_event_header *)pGlobalEVT;
|
|
105 offset_in=0;
|
|
106 for (events_count = 0, offset_in = 0; offset_in < uGlobalEVT_Size; ++events_count)
|
|
107 {
|
|
108 pGlobalEVT_Index[events_count].uEventID=current_hdr->evt_id_l+(current_hdr->evt_id_h<<8);
|
|
109 pGlobalEVT_Index[events_count].event_sequence_num=current_hdr->evt_sequence_num;
|
|
110 pGlobalEVT_Index[events_count].uEventOffsetInEVT=offset_in;
|
|
111 offset_in+=current_hdr->evt_size+1;
|
|
112 current_hdr=(raw_event_header *)&pGlobalEVT[offset_in];
|
|
113 }
|
|
114 uGlobalEVT_NumEvents = events_count;
|
|
115
|
|
116 }
|
|
117
|
|
118
|
|
119 //----- (00443EF8) --------------------------------------------------------
|
|
120 void LoadLevel_InitializeLevelEvt()
|
|
121 {
|
|
122 if (!uLevelEVT_Size)
|
|
123 return;
|
|
124
|
|
125 memset(array_5B5928, 0, 3200);
|
|
126 memset(pLevelEVT_Index, 80, 52800);
|
|
127
|
|
128 uLevelEVT_NumEvents = 0;
|
|
129 dword_5B65C8 = 0;
|
|
130
|
|
131 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i)
|
|
132 {
|
|
133 pLevelEVT_Index[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8);
|
|
134 pLevelEVT_Index[i].event_sequence_num = pLevelEVT[j + 3];
|
|
135 pLevelEVT_Index[i].uEventOffsetInEVT = j;
|
|
136 j += pLevelEVT[j] + 1;
|
|
137 uLevelEVT_NumEvents++;
|
|
138 }
|
|
139 }
|
|
140
|
|
141
|
|
142 //----- (0044684A) --------------------------------------------------------
|
|
143 void EventProcessor(int uEventID, int a2, int a3)
|
|
144 {
|
|
145 unsigned int v3; // eax@5
|
|
146 //signed int v4; // esi@7
|
|
147 //char *v5; // eax@8
|
|
148 Player *v6; // ecx@8
|
|
149 //char *v7; // ebp@8
|
|
150 //signed int v8; // edx@10
|
|
151 //int v9; // edi@12
|
|
152 //ByteArray *v10; // esi@12
|
|
153 int v11; // eax@14
|
|
154 char *v12; // eax@15
|
|
155 //char *v13; // edi@21
|
|
156 int v14; // ebp@21
|
|
157 int v15; // edi@21
|
|
158 const char *v16; // esi@21
|
|
159 bool v17; // edx@21
|
|
160 int v18; // ecx@22
|
|
161 int v19; // ebp@36
|
|
162 signed int v20; // ecx@40
|
|
163 int v21; // eax@40
|
|
164 int v22; // edx@40
|
|
165 int v23; // eax@40
|
|
166 unsigned __int16 v24; // ax@45
|
|
167 int v25; // eax@54
|
|
168 LevelDecoration *v26; // eax@55
|
|
169 int v27; // eax@57
|
|
170 int v28; // ecx@57
|
|
171 int v29; // edx@58
|
|
172 int v30; // eax@58
|
|
173 int v31; // ecx@58
|
|
174 int v32; // esi@58
|
|
175 NPCData *v33; // ecx@58
|
|
176 int v34; // esi@59
|
|
177 int v35; // esi@60
|
|
178 int v36; // esi@61
|
|
179 int v37; // esi@62
|
|
180 int v38; // eax@78
|
|
181 int v39; // ecx@78
|
|
182 size_t v40; // edx@78
|
|
183 Actor *v41; // esi@79
|
|
184 int v42; // eax@84
|
|
185 int v43; // ecx@84
|
|
186 size_t v44; // edx@84
|
|
187 Actor *v45; // esi@85
|
|
188 void *v46; // eax@91
|
|
189 GUIWindow *v47; // eax@93
|
|
190 GUIButton *v48; // ecx@93
|
|
191 GUIButton *v49; // esi@94
|
|
192 char v50; // al@100
|
|
193 Player *v51; // esi@103
|
|
194 Player *v52; // ecx@106
|
|
195 int v53; // ecx@107
|
|
196 char v54; // al@111
|
|
197 Player *v55; // esi@114
|
|
198 Player *v56; // ecx@117
|
|
199 int v57; // ecx@118
|
|
200 signed int v58; // ebp@124
|
|
201 Player *v59; // esi@125
|
|
202 int v60; // eax@126
|
|
203 int v61; // edx@133
|
|
204 int v62; // eax@139
|
|
205 void *v63; // ebp@145
|
|
206 signed int v64; // edi@146
|
|
207 unsigned int v65; // edx@148
|
|
208 Player *v66; // ecx@148
|
|
209 int v67; // esi@148
|
|
210 signed int v68; // eax@151
|
|
211 int v69; // esi@151
|
|
212 Player *v70; // ecx@158
|
|
213 unsigned int v71; // eax@159
|
|
214 int v72; // esi@159
|
|
215 signed int v73; // eax@162
|
|
216 int v74; // esi@162
|
|
217 int v75; // edx@172
|
|
218 Player *v76; // esi@173
|
|
219 signed int v77; // ebp@186
|
|
220 int v78; // edx@186
|
|
221 Player *v79; // esi@187
|
|
222 signed int v80; // ebp@200
|
|
223 int v81; // edx@200
|
|
224 Player *v82; // esi@201
|
|
225 int v83; // eax@212
|
|
226 int v84; // ebp@220
|
|
227 signed int v85; // ebp@224
|
|
228 char v86; // al@224
|
|
229 Player *v87; // esi@227
|
|
230 Player *v88; // ecx@231
|
|
231 int v89; // ecx@232
|
|
232 int v90; // eax@243
|
|
233 const char *v91; // ecx@247
|
|
234 int v92; // eax@251
|
|
235 char *v93; // eax@252
|
|
236 int v94; // ecx@262
|
|
237 int v95; // ebp@262
|
|
238 int v96; // edx@262
|
|
239 int v97; // eax@262
|
|
240 unsigned int v98; // edx@265
|
|
241 const char *v99; // esi@267
|
|
242 int v100; // edx@267
|
|
243 //char *v101; // edi@281
|
|
244 unsigned int v102; // esi@281
|
|
245 int v103; // edi@284
|
|
246 int v104; // eax@288
|
|
247 int v105; // edx@294
|
|
248 int v106; // [sp-20h] [bp-4C8h]@278
|
|
249 signed int v107; // [sp-1Ch] [bp-4C4h]@278
|
|
250 unsigned int v108; // [sp-18h] [bp-4C0h]@278
|
|
251 signed int v109; // [sp-14h] [bp-4BCh]@278
|
|
252 signed int v110; // [sp-10h] [bp-4B8h]@278
|
|
253 int v111; // [sp-Ch] [bp-4B4h]@278
|
|
254 // Event *v112; // [sp-8h] [bp-4B0h]@5
|
|
255 int v113; // [sp-8h] [bp-4B0h]@106
|
|
256 int v114; // [sp-8h] [bp-4B0h]@117
|
|
257 signed int v115; // [sp-8h] [bp-4B0h]@231
|
|
258 unsigned int v116; // [sp-8h] [bp-4B0h]@278
|
|
259 int v117; // [sp-4h] [bp-4ACh]@106
|
|
260 int v118; // [sp-4h] [bp-4ACh]@117
|
|
261 int v119; // [sp-4h] [bp-4ACh]@231
|
|
262 int v120; // [sp-4h] [bp-4ACh]@278
|
|
263 int v121; // [sp-4h] [bp-4ACh]@294
|
310
|
264 int curr_seq_num; // [sp+10h] [bp-498h]@4
|
307
|
265 //char *v123; // [sp+14h] [bp-494h]@0
|
|
266 //signed int v124; // [sp+18h] [bp-490h]@7
|
|
267 signed int v125; // [sp+1Ch] [bp-48Ch]@155
|
|
268 int v126; // [sp+1Ch] [bp-48Ch]@262
|
|
269 int v127; // [sp+20h] [bp-488h]@4
|
|
270 int v128; // [sp+24h] [bp-484h]@21
|
|
271 int v129; // [sp+24h] [bp-484h]@262
|
|
272 signed int v130; // [sp+28h] [bp-480h]@0
|
|
273 //int v131; // [sp+2Ch] [bp-47Ch]@1
|
|
274 int v132; // [sp+30h] [bp-478h]@262
|
|
275 signed int v133; // [sp+34h] [bp-474h]@1
|
|
276 int v134; // [sp+38h] [bp-470h]@262
|
|
277 int v135; // [sp+3Ch] [bp-46Ch]@262
|
|
278 int v136; // [sp+40h] [bp-468h]@40
|
|
279 int v137; // [sp+44h] [bp-464h]@40
|
|
280 int v138; // [sp+48h] [bp-460h]@40
|
|
281 int v139; // [sp+4Ch] [bp-45Ch]@40
|
|
282 ItemGen item; // [sp+50h] [bp-458h]@15
|
|
283 char Source[120]; // [sp+74h] [bp-434h]@15
|
|
284 char Str[120]; // [sp+ECh] [bp-3BCh]@21
|
|
285 Actor Dst; // [sp+164h] [bp-344h]@53
|
|
286
|
|
287 //v131 = uEventID;
|
|
288 v133 = 0;
|
|
289 dword_5B5920 = a2;
|
|
290 dword_5B65C4 = 0;
|
|
291 if ( !a1 )
|
|
292 {
|
|
293 if ( !GameUI_StatusBar_TimedStringTimeLeft )
|
|
294 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
|
|
295 return;
|
|
296 }
|
310
|
297 v127 = 2 * (uActiveCharacter == 0) + 4; //4 and 6
|
|
298 curr_seq_num = dword_597F18;
|
307
|
299 if ( _5C3420_pDecoration )
|
|
300 {
|
|
301 uSomeEVT_NumEvents = uGlobalEVT_NumEvents;
|
|
302 pSomeEVT = pGlobalEVT;
|
|
303 memcpy(pSomeEVT_Events, pGlobalEVT_Index, 52800); //4400 evts
|
|
304 }
|
|
305 else
|
|
306 {
|
|
307 uSomeEVT_NumEvents = uLevelEVT_NumEvents;
|
|
308 pSomeEVT = pLevelEVT;
|
|
309 memcpy(pSomeEVT_Events, pLevelEVT_Index, 52800);
|
|
310 }
|
|
311
|
|
312
|
|
313 //v4 = 0;
|
|
314 //v124 = 0;
|
|
315 for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
|
|
316 {
|
|
317 //v5 = pSomeEVT;
|
|
318 //v6 = v123;
|
|
319 //v7 = "";
|
|
320 //while ( 1 )
|
|
321 //{
|
|
322 if ( dword_5B65C4 )
|
|
323 goto LABEL_301;
|
|
324 //v8 = v4;
|
310
|
325 if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].event_sequence_num == curr_seq_num )
|
307
|
326 {
|
|
327 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
|
|
328 //v10 = (ByteArray *)&v5[v9];
|
|
329 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT);
|
|
330
|
310
|
331 switch (_evt->_e_type)
|
307
|
332 {
|
|
333 case EVENT_CheckSeason:
|
|
334 if ( !sub_4465DF_check_season(_evt->v5) )
|
|
335 {
|
310
|
336 ++curr_seq_num;
|
307
|
337 //v4 = v124;
|
|
338 //v5 = pSomeEVT;
|
|
339 //v6 = v123;
|
|
340 //v7 = "";
|
|
341 break;
|
|
342 }
|
|
343 v11 = _evt->v6;
|
|
344 goto LABEL_130;
|
|
345 case EVENT_ShowMovie:
|
|
346 {
|
|
347 strcpy(Source, (char *)&_evt->v7);
|
|
348 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
|
|
349 if ( *v12 == 32 )
|
|
350 *v12 = 0;
|
|
351 if ( pVideoPlayer->field_54 )
|
|
352 pVideoPlayer->Unload();
|
|
353 pVideoPlayer->bStopBeforeSchedule = 0;
|
|
354 pVideoPlayer->pResetflag = 0;
|
|
355 if (pAsyncMouse)
|
|
356 pAsyncMouse->Suspend();
|
|
357 v128 = pCurrentScreen;
|
|
358 //v13 = &pSomeEVT[v9];
|
|
359 //v14 = (unsigned __int8)v13[5];
|
|
360 //v15 = (unsigned __int8)v13[6];
|
|
361 v14 = _evt->v5;
|
|
362 v15 = _evt->v6;
|
|
363 strcpy(Str, Source);
|
|
364 v16 = RemoveQuotes(Str);
|
|
365 VideoPlayer::MovieLoop(v16, 0, v14, 1);
|
|
366 if ( !_strcmpi(v16, "arbiter good") )
|
|
367 {
|
|
368 pParty->uAlignment = 0;
|
|
369 v18 = 0;
|
|
370 LOBYTE(v17) = 1;
|
|
371 SetUserInterface(v18, v17);
|
|
372 if ( !v15 || v128 == 3 )
|
|
373 {
|
|
374 pCurrentScreen = v128;
|
|
375 if ( v128 == 3 )
|
|
376 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
377 if ( v128 == 13 )
|
|
378 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
|
|
379 }
|
|
380 if (pAsyncMouse)
|
|
381 pAsyncMouse->Resume();
|
310
|
382 ++curr_seq_num;
|
307
|
383 //v4 = v124;
|
|
384 //v5 = pSomeEVT;
|
|
385 //v6 = v123;
|
|
386 //v7 = "";
|
|
387 break;
|
|
388 }
|
|
389 if ( !_strcmpi(v16, "arbiter evil") )
|
|
390 {
|
|
391 v18 = 2;
|
|
392 pParty->uAlignment = 2;
|
|
393 LOBYTE(v17) = 1;
|
|
394 SetUserInterface(v18, v17);
|
|
395 if ( !v15 || v128 == 3 )
|
|
396 {
|
|
397 pCurrentScreen = v128;
|
|
398 if ( v128 == 3 )
|
|
399 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
400 if ( v128 == 13 )
|
|
401 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
|
|
402 }
|
|
403 if (pAsyncMouse)
|
|
404 pAsyncMouse->Resume();
|
310
|
405 ++curr_seq_num;
|
307
|
406 //v4 = v124;
|
|
407 //v5 = pSomeEVT;
|
|
408 //v6 = v123;
|
|
409 //v7 = "";
|
|
410
|
|
411 break;
|
|
412 }
|
|
413 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
|
|
414 {
|
|
415 Rest(0x2760u);
|
|
416 pParty->RestAndHeal();
|
|
417 pParty->field_764 = 0;
|
|
418 }
|
|
419 if ( !v15 || v128 == 3 )
|
|
420 {
|
|
421 pCurrentScreen = v128;
|
|
422 if ( v128 == 3 )
|
|
423 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
424 if ( v128 == 13 )
|
|
425 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
|
|
426 }
|
|
427 if (pAsyncMouse)
|
|
428 pAsyncMouse->Resume();
|
310
|
429 ++curr_seq_num;
|
307
|
430 //v4 = v124;
|
|
431 //v5 = pSomeEVT;
|
|
432 //v6 = v123;
|
|
433 //v7 = "";
|
|
434 }
|
|
435 break;
|
|
436 case EVENT_CheckSkill:
|
|
437 {
|
|
438 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
|
|
439 if ( v127 < 0 )
|
|
440 goto LABEL_47;
|
|
441 if ( v127 <= 3 )
|
|
442 {
|
|
443 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5];
|
|
444 }
|
|
445 else
|
|
446 {
|
|
447 if ( v127 == 4 )
|
|
448 {
|
|
449 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
|
|
450 }
|
|
451 else
|
|
452 {
|
|
453 if ( v127 == 5 )
|
|
454 {
|
|
455 v20 = 0;
|
|
456 v21 = 3486 * v130 + _evt->v5;
|
|
457 v136 = 1;
|
|
458 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
|
|
459 v137 = v21 & 0x40;
|
|
460 v138 = v21 & 0x80;
|
|
461 v22 = v21 & 0x100;
|
|
462 v23 = v21 & 0x3F;
|
|
463 v139 = v22;
|
|
464 while ( v23 < v19 || !*(&v136 + _evt->v6) )
|
|
465 {
|
|
466 ++v20;
|
|
467 if ( v20 >= 4 )
|
|
468 {
|
310
|
469 ++curr_seq_num;
|
307
|
470 //v4 = v124;
|
|
471 //v5 = pSomeEVT;
|
|
472 //v6 = v123;
|
|
473 //v7 = "";
|
|
474 break;
|
|
475 }
|
|
476 }
|
|
477 v11 = _evt->v11;
|
|
478 goto LABEL_130;
|
|
479 }
|
|
480 LABEL_47:
|
|
481 //v10 = (ByteArray *)&v5[v9];
|
|
482 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
|
|
483 }
|
|
484 }
|
|
485 v136 = 1;
|
|
486 v137 = v24 & 0x40;
|
|
487 v138 = v24 & 0x80;
|
|
488 v139 = v24 & 0x100;
|
|
489 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
|
|
490 {
|
|
491 v11 = _evt->v11;
|
|
492 goto LABEL_130;
|
|
493 }
|
310
|
494 ++curr_seq_num;
|
307
|
495 //v4 = v124;
|
|
496 //v5 = pSomeEVT;
|
|
497 //v6 = v123;
|
|
498 //v7 = "";
|
|
499 }
|
|
500 break;
|
|
501
|
|
502 case EVENT_SpeakNPC:
|
|
503 if ( a3 )
|
|
504 {
|
|
505 //Actor::Actor(&Dst);
|
|
506 memset(&Dst, 0, 0x344u);
|
|
507 dword_5B65D0_dialogue_actor_npc_id = _evt->v5
|
|
508 + ((_evt->v6
|
|
509 + ((_evt->v7
|
|
510 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
|
|
511 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
|
|
512 Dst.InitializeDialogue(0);
|
|
513 }
|
|
514 else
|
|
515 {
|
|
516 bDialogueUI_InitializeActor_NPC_ID = _evt->v5
|
|
517 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
|
|
518 }
|
310
|
519 ++curr_seq_num;
|
307
|
520 //v4 = v124;
|
|
521 //v5 = pSomeEVT;
|
|
522 //v6 = v123;
|
|
523 //v7 = "";
|
|
524 break;
|
|
525 case EVENT_ChangeEvent:
|
|
526 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
|
|
527 if ( v25 )
|
|
528 {
|
|
529 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = _evt->v5 - 124;
|
|
530 }
|
|
531 else
|
|
532 {
|
|
533 v26 = _5C3420_pDecoration;
|
|
534 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0;
|
|
535 LOBYTE(v26->field_2) |= 0x20u;
|
|
536 }
|
310
|
537 ++curr_seq_num;
|
307
|
538 //v4 = v124;
|
|
539 //v5 = pSomeEVT;
|
|
540 //v6 = v123;
|
|
541 //v7 = "";
|
|
542 break;
|
|
543 case EVENT_SetNPCGreeting:
|
|
544 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
545 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
546 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
|
|
547 pNPCStats->pNewNPCData[v27].greet = v28;
|
310
|
548 ++curr_seq_num;
|
307
|
549 //v4 = v124;
|
|
550 //v5 = pSomeEVT;
|
|
551 //v6 = v123;
|
|
552 //v7 = "";
|
|
553 break;
|
|
554 case EVENT_SetNPCTopic:
|
310
|
555 {
|
|
556
|
307
|
557 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
558 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
|
|
559 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
560 v32 = _evt->v9;
|
|
561 v33 = &pNPCStats->pNewNPCData[v31];
|
|
562 if ( v32 )
|
|
563 {
|
|
564 v34 = v32 - 1;
|
|
565 if ( v34 )
|
|
566 {
|
|
567 v35 = v34 - 1;
|
|
568 if ( v35 )
|
|
569 {
|
|
570 v36 = v35 - 1;
|
|
571 if ( v36 )
|
|
572 {
|
|
573 v37 = v36 - 1;
|
|
574 if ( v37 )
|
|
575 {
|
|
576 if ( v37 == 1 )
|
|
577 v33->evt_F = v30;
|
|
578 }
|
|
579 else
|
|
580 {
|
|
581 v33->evt_E = v30;
|
|
582 }
|
|
583 }
|
|
584 else
|
|
585 {
|
|
586 v33->evt_D = v30;
|
|
587 }
|
|
588 }
|
|
589 else
|
|
590 {
|
|
591 v33->evt_C = v30;
|
|
592 }
|
|
593 }
|
|
594 else
|
|
595 {
|
|
596 v33->evt_B = v30;
|
|
597 }
|
|
598 }
|
|
599 else
|
|
600 {
|
|
601 v33->evt_A = v30;
|
|
602 }
|
|
603 if ( v29 == 8 )
|
|
604 {
|
|
605 if ( v30 == 78 )
|
|
606 {
|
|
607 sub_4BD8B5();
|
|
608 ptr_507BC0->Release();
|
|
609 pParty->uFlags &= 0xFFFFFFFDu;
|
|
610 if ( EnterHouse((enum HOUSE_TYPE)170) )
|
|
611 {
|
|
612 pAudioPlayer->StopChannels(-1, -1);
|
|
613 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
|
|
614 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
|
|
615 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
|
|
616 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
|
|
617 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
|
|
618 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
|
|
619 ptr_F8B1E8 = pNPCTopics[90].pText;
|
|
620 }
|
|
621 }
|
|
622 }
|
310
|
623 ++curr_seq_num;
|
|
624 }
|
307
|
625 //v4 = v124;
|
|
626 //v5 = pSomeEVT;
|
|
627 //v6 = v123;
|
|
628 //v7 = "";
|
|
629 break;
|
|
630 case EVENT_NPCSetItem:
|
|
631 sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
632 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
|
310
|
633 ++curr_seq_num;
|
307
|
634 //v4 = v124;
|
|
635 //v5 = pSomeEVT;
|
|
636 //v6 = v123;
|
|
637 //v7 = "";
|
|
638 break;
|
|
639 case EVENT_SetActorItem:
|
|
640 Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
641 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
|
310
|
642 ++curr_seq_num;
|
307
|
643 //v4 = v124;
|
|
644 //v5 = pSomeEVT;
|
|
645 //v6 = v123;
|
|
646 //v7 = "";
|
|
647 break;
|
|
648 case EVENT_SetNPCGroupNews:
|
|
649 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
|
310
|
650 ++curr_seq_num;
|
307
|
651 //v4 = v124;
|
|
652 //v5 = pSomeEVT;
|
|
653 //v6 = v123;
|
|
654 //v7 = "";
|
|
655 break;
|
|
656 case EVENT_SetActorGroup:
|
|
657 __debugbreak();
|
|
658 *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
310
|
659 ++curr_seq_num;
|
307
|
660 //v4 = v124;
|
|
661 //v5 = pSomeEVT;
|
|
662 //v6 = v123;
|
|
663 //v7 = "";
|
|
664 break;
|
|
665 case EVENT_ChangeGroup:
|
|
666 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
667 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
668 v40 = uNumActors;
|
|
669 __debugbreak();
|
|
670 if ( (signed int)uNumActors > 0 )
|
|
671 {
|
|
672 v41 = pActors;//[0].uGroup;
|
|
673 do
|
|
674 {
|
|
675 if ( v41->uGroup == v38 )
|
|
676 v41->uGroup = v39;
|
|
677 ++v41;
|
|
678 --v40;
|
|
679 }
|
|
680 while ( v40 );
|
|
681 }
|
310
|
682 ++curr_seq_num;
|
307
|
683 //v4 = v124;
|
|
684 //v5 = pSomeEVT;
|
|
685 //v6 = v123;
|
|
686 //v7 = "";
|
|
687 break;
|
|
688 case EVENT_ChangeGroupAlly:
|
|
689 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
690 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
691 v44 = uNumActors;
|
|
692 __debugbreak();
|
|
693 if ( (signed int)uNumActors > 0 )
|
|
694 {
|
|
695 v45 = pActors;//[0].uAlly;
|
|
696 do
|
|
697 {
|
|
698 if ( v45->uGroup == v42 )
|
|
699 v45->uAlly = v43;
|
|
700 ++v45;
|
|
701 --v44;
|
|
702 }
|
|
703 while ( v44 );
|
|
704 }
|
310
|
705 ++curr_seq_num;
|
307
|
706 //v4 = v124;
|
|
707 //v5 = pSomeEVT;
|
|
708 //v6 = v123;
|
|
709 //v7 = "";
|
|
710 break;
|
|
711 case EVENT_MoveNPC:
|
310
|
712 {
|
|
713
|
307
|
714 pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].Location2D = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
715 if ( ptr_507BC0 )
|
|
716 {
|
|
717 v46 = ptr_507BC0->ptr_1C;
|
|
718 if ( v46 == (void *)165 )
|
|
719 {
|
|
720 sub_4BD8B5();
|
|
721 pVideoPlayer->Unload();
|
|
722 ptr_507BC0->Release();
|
|
723 pParty->uFlags &= 0xFFFFFFFDu;
|
|
724 _5C3420_pDecoration = (LevelDecoration *)1;
|
|
725 if ( EnterHouse((enum HOUSE_TYPE)165) )
|
|
726 {
|
|
727 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
|
|
728 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
|
|
729 ptr_507BC0 = v47;
|
|
730 v48 = v47->pControlsHead;
|
|
731 if ( v48 )
|
|
732 {
|
|
733 do
|
|
734 {
|
|
735 v49 = v48->pNext;
|
|
736 pAllocator->FreeChunk(v48);
|
|
737 v48 = v49;
|
|
738 }
|
|
739 while ( v49 );
|
|
740 v47 = ptr_507BC0;
|
|
741 }
|
|
742 v47->pControlsHead = 0;
|
|
743 ptr_507BC0->pControlsTail = 0;
|
|
744 ptr_507BC0->uNumControls = 0;
|
|
745 }
|
|
746 }
|
|
747 else
|
|
748 {
|
|
749 if ( v46 == (void *)553 )
|
|
750 pVideoPlayer->bLoopPlaying = 0;
|
|
751 }
|
|
752 }
|
310
|
753 ++curr_seq_num;
|
|
754 }
|
307
|
755 //v4 = v124;
|
|
756 //v5 = pSomeEVT;
|
|
757 //v6 = v123;
|
|
758 //v7 = "";
|
|
759 break;
|
|
760 case EVENT_Jmp:
|
|
761 //v124 = -1;
|
310
|
762 curr_seq_num = _evt->v5 - 1;
|
|
763 ++curr_seq_num;
|
307
|
764 //v4 = v124;
|
|
765 //v5 = pSomeEVT;
|
|
766 //v6 = v123;
|
|
767 //v7 = "";
|
|
768 break;
|
|
769 case EVENT_ShowFace:
|
|
770 v50 = _evt->v5;
|
|
771 if ( (unsigned __int8)v50 <= 3u )
|
|
772 {
|
|
773 v117 = 0;
|
|
774 v113 = _evt->v6;
|
|
775 v53 = (unsigned __int8)v50;
|
|
776 v52 = &pParty->pPlayers[v53];
|
|
777 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
|
310
|
778 ++curr_seq_num;
|
307
|
779 //v4 = v124;
|
|
780 //v5 = pSomeEVT;
|
|
781 //v6 = v123;
|
|
782 //v7 = "";
|
|
783 break;
|
|
784 }
|
|
785 if ( v50 == 4 )
|
|
786 {
|
|
787 v117 = 0;
|
|
788 v113 = _evt->v6;
|
|
789 v52 = pPlayers[uActiveCharacter];
|
|
790 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
|
310
|
791 ++curr_seq_num;
|
307
|
792 //v4 = v124;
|
|
793 //v5 = pSomeEVT;
|
|
794 //v6 = v123;
|
|
795 //v7 = "";
|
|
796 break;
|
|
797 }
|
|
798 if ( v50 != 5 )
|
|
799 {
|
|
800 v117 = 0;
|
|
801 v113 = _evt->v6;
|
|
802 v53 = rand() % 4;
|
|
803 v52 = &pParty->pPlayers[v53];
|
|
804 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117);
|
310
|
805 ++curr_seq_num;
|
307
|
806 //v4 = v124;
|
|
807 //v5 = pSomeEVT;
|
|
808 //v6 = v123;
|
|
809 //v7 = "";
|
|
810 break;
|
|
811 }
|
|
812 v51 = pParty->pPlayers;
|
|
813 do
|
|
814 {
|
|
815 v51->PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
|
|
816 ++v51;
|
|
817 }
|
|
818 while ( (signed int)v51 < (signed int)pParty->pHirelings );
|
|
819 //LABEL_291:
|
310
|
820 ++curr_seq_num;
|
307
|
821 //v4 = v124;
|
|
822 //v5 = pSomeEVT;
|
|
823 //v6 = v123;
|
|
824 //v7 = "";
|
|
825 break;
|
|
826 case EVENT_CharacterAnimation:
|
|
827 v54 = _evt->v5;
|
|
828 if ( (unsigned __int8)v54 <= 3u )
|
|
829 {
|
|
830 v118 = 0;
|
|
831 v114 = _evt->v6;
|
|
832 v57 = (unsigned __int8)v54;
|
|
833 goto LABEL_119;
|
|
834 }
|
|
835 if ( v54 == 4 )
|
|
836 {
|
|
837 v118 = 0;
|
|
838 v114 = _evt->v6;
|
|
839 v56 = pPlayers[uActiveCharacter];
|
|
840 goto LABEL_120;
|
|
841 }
|
|
842 if ( v54 != 5 )
|
|
843 {
|
|
844 v118 = 0;
|
|
845 v114 = _evt->v6;
|
|
846 v57 = rand() % 4;
|
|
847 LABEL_119:
|
|
848 v56 = &pParty->pPlayers[v57];
|
|
849 LABEL_120:
|
|
850 v56->PlaySound((PlayerSpeech)v114, v118);
|
310
|
851 ++curr_seq_num;
|
307
|
852 //v4 = v124;
|
|
853 //v5 = pSomeEVT;
|
|
854 //v6 = v123;
|
|
855 //v7 = "";
|
|
856 break;
|
|
857 }
|
|
858 v55 = pParty->pPlayers;
|
|
859 for (int iii = 0; iii < 4; ++iii)
|
|
860 {
|
|
861 v55->PlaySound((PlayerSpeech)_evt->v6, 0);
|
|
862 ++v55;
|
|
863 }
|
|
864 //while ( (signed int)v55 < (signed int)pParty->pHirelings );
|
310
|
865 ++curr_seq_num;
|
307
|
866 //v4 = v124;
|
|
867 //v5 = pSomeEVT;
|
|
868 //v6 = v123;
|
|
869 //v7 = "";
|
|
870 break;
|
|
871 case EVENT_ForPartyMember:
|
|
872 v127 = _evt->v5;
|
310
|
873 ++curr_seq_num;
|
307
|
874 //v4 = v124;
|
|
875 //v5 = pSomeEVT;
|
|
876 //v6 = v123;
|
|
877 //v7 = "";
|
|
878 break;
|
|
879 case EVENT_SummonItem:
|
|
880 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
881 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
|
|
882 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
|
|
883 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
|
|
884 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
|
|
885 _evt->v25, _evt->v26, 0, 0);
|
310
|
886 ++curr_seq_num;
|
307
|
887 //v4 = v124;
|
|
888 //v5 = pSomeEVT;
|
|
889 //v6 = v123;
|
|
890 //v7 = "";
|
|
891 break;
|
|
892 case EVENT_Compare:
|
|
893 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
894 if ( v127 == 5 )
|
|
895 {
|
|
896 v130 = 0;
|
|
897 v59 = pParty->pPlayers;
|
|
898 while ( 1 )
|
|
899 {
|
|
900 LOBYTE(v60) = v59->CompareVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v58);
|
|
901 if ( v60 )
|
|
902 break;
|
|
903 ++v130;
|
|
904 ++v59;
|
|
905 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
|
|
906 {
|
310
|
907 ++curr_seq_num;
|
307
|
908 //v4 = v124;
|
|
909 //v5 = pSomeEVT;
|
|
910 //v6 = v123;
|
|
911 //v7 = "";
|
|
912 break;
|
|
913 }
|
|
914 }
|
|
915 LABEL_129:
|
|
916 v11 = _evt->v11;
|
|
917 goto LABEL_130;
|
|
918 }
|
|
919 if ( v127 < 0 )
|
|
920 goto LABEL_139;
|
|
921 v61 = v127;
|
|
922 if ( v127 <= 3 )
|
|
923 goto LABEL_137;
|
|
924 if ( v127 == 4 )
|
|
925 {
|
|
926 if ( uActiveCharacter )
|
|
927 {
|
|
928 v6 = pPlayers[uActiveCharacter];
|
|
929 goto LABEL_138;
|
|
930 }
|
|
931 }
|
|
932 else
|
|
933 {
|
|
934 if ( v127 != 6 )
|
|
935 goto LABEL_139;
|
|
936 }
|
|
937 v61 = rand() % 4;
|
|
938 //v5 = pSomeEVT;
|
|
939 LABEL_137:
|
|
940 v6 = &pParty->pPlayers[v61];
|
|
941 LABEL_138:
|
|
942 //v123 = v6;
|
|
943 LABEL_139:
|
|
944 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
|
|
945 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
|
|
946 v58);
|
|
947 LABEL_140:
|
|
948 if ( v62 )
|
|
949 goto LABEL_129;
|
310
|
950 ++curr_seq_num;
|
307
|
951 //v4 = v124;
|
|
952 //v5 = pSomeEVT;
|
|
953 //v6 = v123;
|
|
954 //v7 = "";
|
|
955 break;
|
|
956 case EVENT_IsActorAlive:
|
|
957 v62 = IsActorAlive(
|
|
958 _evt->v5,
|
|
959 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8),
|
|
960 _evt->v10);
|
|
961 goto LABEL_140;
|
|
962 case EVENT_Substract:
|
|
963 v63 = (void *)(_evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8));
|
|
964 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands )
|
|
965 {
|
|
966 v64 = 0;
|
|
967 if ( (void *)pParty->pPickedItem.uItemID == v63 )
|
|
968 {
|
|
969 pMouse->RemoveHoldingItem();
|
310
|
970 ++curr_seq_num;
|
307
|
971 //v4 = v124;
|
|
972 //v5 = pSomeEVT;
|
|
973 //v6 = v123;
|
|
974 //v7 = "";
|
|
975 break;
|
|
976 }
|
|
977 v65 = 0;
|
|
978 v66 = pPlayers[uActiveCharacter];
|
|
979 v67 = (int)v66->pInventoryIndices;
|
|
980 do
|
|
981 {
|
|
982 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
|
|
983 {
|
|
984 v66->RemoveItemAtInventoryIndex(v65);
|
310
|
985 ++curr_seq_num;
|
307
|
986 //v4 = v124;
|
|
987 //v5 = pSomeEVT;
|
|
988 //v6 = v123;
|
|
989 //v7 = "";
|
|
990 break;
|
|
991 }
|
|
992 ++v65;
|
|
993 v67 += 4;
|
|
994 }
|
|
995 while ( (signed int)v65 < 126 );
|
|
996 v68 = 0;
|
|
997 v69 = (int)&v66->pEquipment;
|
|
998 do
|
|
999 {
|
|
1000 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
|
|
1001 {
|
|
1002 *(&v66->pEquipment.uOffHand + v68) = 0;
|
310
|
1003 ++curr_seq_num;
|
307
|
1004 //v4 = v124;
|
|
1005 //v5 = pSomeEVT;
|
|
1006 //v6 = v123;
|
|
1007 //v7 = "";
|
|
1008 break;
|
|
1009 }
|
|
1010 ++v68;
|
|
1011 v69 += 4;
|
|
1012 }
|
|
1013 while ( v68 < 16 );
|
|
1014 v125 = (signed int)&pPlayers[1];
|
|
1015 while ( 1 )
|
|
1016 {
|
|
1017 v70 = *(Player **)v125;
|
|
1018 if ( !v64 )
|
|
1019 {
|
|
1020 v71 = 0;
|
|
1021 v72 = (int)v70->pInventoryIndices;
|
|
1022 do
|
|
1023 {
|
|
1024 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
|
|
1025 {
|
|
1026 v70->RemoveItemAtInventoryIndex(v71);
|
|
1027 goto LABEL_169;
|
|
1028 }
|
|
1029 ++v71;
|
|
1030 v72 += 4;
|
|
1031 }
|
|
1032 while ( (signed int)v71 < 126 );
|
|
1033 v73 = 0;
|
|
1034 v74 = (int)&v70->pEquipment;
|
|
1035 while ( !*(int *)v74
|
|
1036 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
|
|
1037 {
|
|
1038 ++v73;
|
|
1039 v74 += 4;
|
|
1040 if ( v73 >= 16 )
|
|
1041 goto LABEL_170;
|
|
1042 }
|
|
1043 *(&v70->pEquipment.uOffHand + v73) = 0;
|
|
1044 LABEL_169:
|
|
1045 v64 = 1;
|
|
1046 }
|
|
1047 LABEL_170:
|
|
1048 v125 += 4;
|
|
1049 if ( v125 > (signed int)&pPlayers[4] )
|
|
1050 {
|
310
|
1051 ++curr_seq_num;
|
307
|
1052 //v4 = v124;
|
|
1053 //v5 = pSomeEVT;
|
|
1054 //v6 = v123;
|
|
1055 //v7 = "";
|
|
1056 break;
|
|
1057 }
|
|
1058 }
|
|
1059 }
|
|
1060 v75 = v127;
|
|
1061 if ( v127 != 5 )
|
|
1062 {
|
|
1063 if ( v127 < 0 )
|
|
1064 goto LABEL_183;
|
|
1065 if ( v127 > 3 )
|
|
1066 {
|
|
1067 if ( v127 != 4 )
|
|
1068 {
|
|
1069 if ( v127 == 6 )
|
|
1070 goto LABEL_180;
|
|
1071 LABEL_183:
|
|
1072 ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63);
|
310
|
1073 ++curr_seq_num;
|
307
|
1074 //v4 = v124;
|
|
1075 //v5 = pSomeEVT;
|
|
1076 //v6 = v123;
|
|
1077 //v7 = "";
|
|
1078 break;
|
|
1079 }
|
|
1080 if ( uActiveCharacter )
|
|
1081 {
|
|
1082 v6 = pPlayers[uActiveCharacter];
|
|
1083 goto LABEL_182;
|
|
1084 }
|
|
1085 LABEL_180:
|
|
1086 v75 = rand() % 4;
|
|
1087 //v5 = pSomeEVT;
|
|
1088 }
|
|
1089 v6 = &pParty->pPlayers[v75];
|
|
1090 LABEL_182:
|
|
1091 //v123 = v6;
|
|
1092 goto LABEL_183;
|
|
1093 }
|
|
1094 v76 = pParty->pPlayers;
|
|
1095 v130 = 4;
|
|
1096 do
|
|
1097 {
|
|
1098 v76->SubtractVariable(
|
|
1099 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
|
|
1100 v63);
|
|
1101 ++v76;
|
|
1102 }
|
|
1103 while ( (signed int)v76 < (signed int)pParty->pHirelings );
|
310
|
1104 ++curr_seq_num;
|
307
|
1105 //v4 = v124;
|
|
1106 //v5 = pSomeEVT;
|
|
1107 //v6 = v123;
|
|
1108 //v7 = "";
|
|
1109 break;
|
|
1110 case EVENT_Set:
|
|
1111 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1112 v78 = v127;
|
|
1113 if ( v127 != 5 )
|
|
1114 {
|
|
1115 if ( v127 < 0 )
|
|
1116 goto LABEL_197;
|
|
1117 if ( v127 > 3 )
|
|
1118 {
|
|
1119 if ( v127 != 4 )
|
|
1120 {
|
|
1121 if ( v127 == 6 )
|
|
1122 goto LABEL_194;
|
|
1123 LABEL_197:
|
|
1124 ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77);
|
310
|
1125 ++curr_seq_num;
|
307
|
1126 //v4 = v124;
|
|
1127 //v5 = pSomeEVT;
|
|
1128 //v6 = v123;
|
|
1129 //v7 = "";
|
|
1130 break;
|
|
1131 }
|
|
1132 if ( uActiveCharacter )
|
|
1133 {
|
|
1134 v6 = pPlayers[uActiveCharacter];
|
|
1135 goto LABEL_196;
|
|
1136 }
|
|
1137 LABEL_194:
|
|
1138 v78 = rand() % 4;
|
|
1139 //v5 = pSomeEVT;
|
|
1140 }
|
|
1141 v6 = &pParty->pPlayers[v78];
|
|
1142 LABEL_196:
|
|
1143 //v123 = v6;
|
|
1144 goto LABEL_197;
|
|
1145 }
|
|
1146 v79 = pParty->pPlayers;
|
|
1147 v130 = 4;
|
|
1148 do
|
|
1149 {
|
|
1150 v79->SetVariable(
|
|
1151 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
|
|
1152 v77);
|
|
1153 ++v79;
|
|
1154 }
|
|
1155 while ( (signed int)v79 < (signed int)pParty->pHirelings );
|
310
|
1156 ++curr_seq_num;
|
307
|
1157 //v4 = v124;
|
|
1158 //v5 = pSomeEVT;
|
|
1159 //v6 = v123;
|
|
1160 //v7 = "";
|
|
1161 break;
|
|
1162 case EVENT_Add:
|
|
1163 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1164 v81 = v127;
|
|
1165 if ( v127 != 5 )
|
|
1166 {
|
|
1167 if ( v127 < 0 )
|
|
1168 goto LABEL_211;
|
|
1169 if ( v127 > 3 )
|
|
1170 {
|
|
1171 if ( v127 != 4 )
|
|
1172 {
|
|
1173 if ( v127 == 6 )
|
|
1174 goto LABEL_208;
|
|
1175 LABEL_211:
|
|
1176 ((Player *)v6)->AddVariable(
|
|
1177 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
|
|
1178 v80);
|
|
1179 goto LABEL_212;
|
|
1180 }
|
|
1181 if ( uActiveCharacter )
|
|
1182 {
|
|
1183 v6 = pPlayers[uActiveCharacter];
|
|
1184 goto LABEL_210;
|
|
1185 }
|
|
1186 LABEL_208:
|
|
1187 v81 = rand() % 4;
|
|
1188 //v5 = pSomeEVT;
|
|
1189 }
|
|
1190 v6 = &pParty->pPlayers[v81];
|
|
1191 LABEL_210:
|
|
1192 //v123 = v6;
|
|
1193 goto LABEL_211;
|
|
1194 }
|
|
1195 v82 = pParty->pPlayers;
|
|
1196 v130 = 4;
|
|
1197 do
|
|
1198 {
|
|
1199 v82->AddVariable(
|
|
1200 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
|
|
1201 v80);
|
|
1202 ++v82;
|
|
1203 }
|
|
1204 while ( (signed int)v82 < (signed int)pParty->pHirelings );
|
|
1205 LABEL_212:
|
|
1206 v83 = _evt->v5 + ((uint)_evt->v6 << 8);
|
|
1207 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
|
|
1208 viewparams->bRedrawGameUI = 1;
|
310
|
1209 ++curr_seq_num;
|
307
|
1210 //v4 = v124;
|
|
1211 //v5 = pSomeEVT;
|
|
1212 //v6 = v123;
|
|
1213 //v7 = "";
|
|
1214 break;
|
|
1215 case EVENT_InputString:
|
|
1216 if ( !dword_597F18 )
|
|
1217 {
|
|
1218 strcpy(
|
|
1219 GameUI_StatusBar_TimedString,
|
|
1220 &pLevelStr[pLevelStrOffsets[_evt->v5
|
|
1221 + ((_evt->v6
|
|
1222 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
|
310
|
1223 v105 = curr_seq_num;
|
307
|
1224 v121 = 26;
|
|
1225 LABEL_295:
|
|
1226 sub_4451A8_press_any_key(uEventID, v105, v121);
|
|
1227 LABEL_301:
|
|
1228 if ( v133 == 1 )
|
|
1229 LABEL_302:
|
|
1230 OnMapLeave();
|
|
1231 return;
|
|
1232 }
|
|
1233 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
1234 if ( !_strcmpi(
|
|
1235 GameUI_StatusBar_TimedString,
|
|
1236 &pLevelStr[pLevelStrOffsets[_evt->v9
|
|
1237 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
|
|
1238 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
|
|
1239 {
|
|
1240 v11 = _evt->v17;
|
|
1241 LABEL_130:
|
|
1242 //v124 = -1;
|
|
1243 LABEL_131:
|
310
|
1244 curr_seq_num = v11 - 1;
|
307
|
1245 }
|
310
|
1246 ++curr_seq_num;
|
307
|
1247 //v4 = v124;
|
|
1248 //v5 = pSomeEVT;
|
|
1249 //v6 = v123;
|
|
1250 //v7 = "";
|
|
1251 break;
|
|
1252 case EVENT_RandomGoTo:
|
|
1253 //v124 = -1;
|
|
1254 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
|
|
1255 + (_evt->v10 != 0)));
|
|
1256 goto LABEL_131;
|
|
1257 case EVENT_ReceiveDamage:
|
|
1258 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1259 v86 = _evt->v5;
|
|
1260 if ( (unsigned __int8)v86 <= 3u )
|
|
1261 {
|
|
1262 v119 = _evt->v6;
|
|
1263 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1264 v89 = (unsigned __int8)v86;
|
|
1265 goto LABEL_233;
|
|
1266 }
|
|
1267 if ( v86 == 4 )
|
|
1268 {
|
|
1269 if ( !uActiveCharacter )
|
|
1270 {
|
310
|
1271 ++curr_seq_num;
|
307
|
1272 //v4 = v124;
|
|
1273 //v5 = pSomeEVT;
|
|
1274 //v6 = v123;
|
|
1275 //v7 = "";
|
|
1276 break;
|
|
1277 }
|
|
1278 v119 = _evt->v6;
|
|
1279 v88 = pPlayers[uActiveCharacter];
|
|
1280 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1281 goto LABEL_234;
|
|
1282 }
|
|
1283 if ( v86 != 5 )
|
|
1284 {
|
|
1285 v119 = _evt->v6;
|
310
|
1286 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10<< 8)) << 8)) << 8);
|
307
|
1287 v89 = rand() % 4;
|
|
1288 LABEL_233:
|
|
1289 v88 = &pParty->pPlayers[v89];
|
|
1290 LABEL_234:
|
|
1291 v88->ReceiveDamage(v115, v119);
|
310
|
1292 ++curr_seq_num;
|
307
|
1293 //v4 = v124;
|
|
1294 //v5 = pSomeEVT;
|
|
1295 //v6 = v123;
|
|
1296 //v7 = "";
|
|
1297 break;
|
|
1298 }
|
|
1299 v87 = pParty->pPlayers;
|
|
1300 do
|
|
1301 {
|
|
1302 v87->ReceiveDamage(v85, _evt->v6);
|
|
1303 ++v87;
|
|
1304 }
|
|
1305 while ( (signed int)v87 < (signed int)pParty->pHirelings );
|
310
|
1306 ++curr_seq_num;
|
307
|
1307 //v4 = v124;
|
|
1308 //v5 = pSomeEVT;
|
|
1309 //v6 = v123;
|
|
1310 //v7 = "";
|
|
1311 break;
|
|
1312 case EVENT_ToggleIndoorLight:
|
|
1313 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
|
310
|
1314 ++curr_seq_num;
|
307
|
1315 //v4 = v124;
|
|
1316 //v5 = pSomeEVT;
|
|
1317 //v6 = v123;
|
|
1318 //v7 = "";
|
|
1319 break;
|
|
1320 case EVENT_SetFacesBit:
|
|
1321 sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
1322 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
|
310
|
1323 ++curr_seq_num;
|
307
|
1324 //v4 = v124;
|
|
1325 //v5 = pSomeEVT;
|
|
1326 //v6 = v123;
|
|
1327 //v7 = "";
|
|
1328 break;
|
|
1329 case EVENT_ToggleChestFlag:
|
|
1330 Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
1331 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
|
310
|
1332 ++curr_seq_num;
|
307
|
1333 //v4 = v124;
|
|
1334 //v5 = pSomeEVT;
|
|
1335 //v6 = v123;
|
|
1336 //v7 = "";
|
|
1337 break;
|
|
1338 case EVENT_ToggleActorFlag:
|
|
1339 Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
1340 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
|
310
|
1341 ++curr_seq_num;
|
307
|
1342 //v4 = v124;
|
|
1343 //v5 = pSomeEVT;
|
|
1344 //v6 = v123;
|
|
1345 //v7 = "";
|
|
1346 break;
|
|
1347 case EVENT_ToggleActorGroupFlag:
|
|
1348 ToggleActorGroupFlag(
|
|
1349 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
1350 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
|
|
1351 _evt->v13);
|
310
|
1352 ++curr_seq_num;
|
307
|
1353 //v4 = v124;
|
|
1354 //v5 = pSomeEVT;
|
|
1355 //v6 = v123;
|
|
1356 //v7 = "";
|
|
1357 break;
|
|
1358 case EVENT_SetSnow:
|
|
1359 if ( !_evt->v5 )
|
|
1360 pWeather->bRenderSnow = _evt->v6 != 0;
|
310
|
1361 ++curr_seq_num;
|
307
|
1362 //v4 = v124;
|
|
1363 //v5 = pSomeEVT;
|
|
1364 //v6 = v123;
|
|
1365 //v7 = "";
|
|
1366 break;
|
|
1367 case EVENT_StatusText:
|
|
1368 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1369 if ( _5C3420_pDecoration )
|
|
1370 {
|
|
1371 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
|
|
1372 {
|
|
1373 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
|
310
|
1374 ++curr_seq_num;
|
307
|
1375 //v4 = v124;
|
|
1376 //v5 = pSomeEVT;
|
|
1377 //v6 = v123;
|
|
1378 //v7 = "";
|
|
1379 break;
|
|
1380 }
|
|
1381 if ( a3 == 1 )
|
|
1382 {
|
|
1383 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
|
|
1384 //LABEL_248:
|
|
1385 ShowStatusBarString(v91, 2u);
|
310
|
1386 ++curr_seq_num;
|
307
|
1387 //v4 = v124;
|
|
1388 //v5 = pSomeEVT;
|
|
1389 //v6 = v123;
|
|
1390 //v7 = "";
|
|
1391 break;
|
|
1392 }
|
|
1393 }
|
|
1394 else
|
|
1395 {
|
|
1396 if ( a3 == 1 )
|
|
1397 {
|
|
1398 v91 = &pLevelStr[pLevelStrOffsets[v90]];
|
|
1399 ShowStatusBarString(v91, 2u);
|
310
|
1400 ++curr_seq_num;
|
307
|
1401 //v4 = v124;
|
|
1402 //v5 = pSomeEVT;
|
|
1403 //v6 = v123;
|
|
1404 //v7 = "";
|
|
1405 break;
|
|
1406 }
|
|
1407 }
|
310
|
1408 ++curr_seq_num;
|
307
|
1409 //v4 = v124;
|
|
1410 //v5 = pSomeEVT;
|
|
1411 //v6 = v123;
|
|
1412 //v7 = "";
|
|
1413 break;
|
|
1414 case EVENT_ShowMessage:
|
|
1415 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1416 if ( _5C3420_pDecoration )
|
|
1417 {
|
|
1418 v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92];
|
|
1419 byte_5B0938[0] = 0;
|
|
1420 ptr_F8B1E8 = v93;
|
|
1421 }
|
|
1422 else
|
|
1423 {
|
|
1424 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
|
|
1425 }
|
310
|
1426 ++curr_seq_num;
|
307
|
1427 //v4 = v124;
|
|
1428 //v5 = pSomeEVT;
|
|
1429 //v6 = v123;
|
|
1430 //v7 = "";
|
|
1431 break;
|
|
1432 case EVENT_CastSpell:
|
|
1433 sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
|
|
1434 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
|
|
1435 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
|
|
1436 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
|
|
1437 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
|
|
1438 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
|
310
|
1439 ++curr_seq_num;
|
307
|
1440 //v4 = v124;
|
|
1441 //v5 = pSomeEVT;
|
|
1442 //v6 = v123;
|
|
1443 //v7 = "";
|
|
1444 break;
|
|
1445 case EVENT_SetTexture:
|
|
1446 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9);
|
310
|
1447 ++curr_seq_num;
|
307
|
1448 //v4 = v124;
|
|
1449 //v5 = pSomeEVT;
|
|
1450 //v6 = v123;
|
|
1451 //v7 = "";
|
|
1452 break;
|
|
1453 case EVENT_SetSprite:
|
|
1454 SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10);
|
310
|
1455 ++curr_seq_num;
|
307
|
1456 //v4 = v124;
|
|
1457 //v5 = pSomeEVT;
|
|
1458 //v6 = v123;
|
|
1459 //v7 = "";
|
|
1460 break;
|
|
1461 case EVENT_SummonMonsters:
|
|
1462 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,
|
|
1463 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
|
|
1464 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
|
|
1465 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
|
|
1466 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
|
|
1467 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
|
310
|
1468 ++curr_seq_num;
|
307
|
1469 //v4 = v124;
|
|
1470 //v5 = pSomeEVT;
|
|
1471 //v6 = v123;
|
|
1472 //v7 = "";
|
|
1473 break;
|
|
1474 case EVENT_MouseOver:
|
|
1475 case EVENT_LocationName:
|
310
|
1476 --curr_seq_num;
|
|
1477 ++curr_seq_num;
|
307
|
1478 //v4 = v124;
|
|
1479 //v5 = pSomeEVT;
|
|
1480 //v6 = v123;
|
|
1481 //v7 = "";
|
|
1482 break;
|
|
1483 case EVENT_ChangeDoorState:
|
|
1484 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
|
310
|
1485 ++curr_seq_num;
|
307
|
1486 //v4 = v124;
|
|
1487 //v5 = pSomeEVT;
|
|
1488 //v6 = v123;
|
|
1489 //v7 = "";
|
|
1490 break;
|
|
1491 case EVENT_OpenChest:
|
|
1492 if ( !Chest::Open(_evt->v5) )
|
|
1493 goto LABEL_301;
|
310
|
1494 ++curr_seq_num;
|
307
|
1495 //v4 = v124;
|
|
1496 //v5 = pSomeEVT;
|
|
1497 //v6 = v123;
|
|
1498 //v7 = "";
|
|
1499 break;
|
|
1500 case EVENT_MoveToMap:
|
|
1501 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1502 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1503 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1504 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
1505 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
|
|
1506 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
|
|
1507 v96 = _evt->v25;
|
|
1508 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
|
|
1509 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
|
|
1510 if ( _evt->v29 || _evt->v30 )
|
|
1511 {
|
|
1512 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
|
|
1513 pRenderer->_49FD3A();
|
|
1514 sub_444839_move_map(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31);
|
|
1515 dword_5C3418 = uEventID;
|
310
|
1516 dword_5C341C = curr_seq_num + 1;
|
307
|
1517 goto LABEL_301;
|
|
1518 }
|
|
1519 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1520 _5B65A8_npcdata_uflags_or_other = v94;
|
|
1521 _5B65B0_npcdata_rep_or_other = v126;
|
|
1522 if ( v129 == -1 )
|
|
1523 {
|
|
1524 v98 = _5B65B4_npcdata_loword_house_or_other;
|
|
1525 }
|
|
1526 else
|
|
1527 {
|
|
1528 v98 = v129 & stru_5C6E00->uDoublePiMask;
|
|
1529 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
|
|
1530 }
|
|
1531 v99 = (char *)&_evt->v31;
|
|
1532 _5B65B8_npcdata_hiword_house_or_other = v95;
|
|
1533 dword_5B65BC = v97;
|
|
1534 v100 = v94 | v132 | v126 | v95 | v97 | v98;
|
|
1535 dword_5B65C0 = v100;
|
|
1536 if ( *v99 == 48 )
|
|
1537 {
|
|
1538 if ( v100 )
|
|
1539 {
|
|
1540 pParty->vPosition.x = v135;
|
|
1541 pParty->vPosition.y = v132;
|
|
1542 pParty->vPosition.z = v126;
|
|
1543 pParty->uFallStartY = v126;
|
|
1544 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
|
|
1545 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
|
|
1546 _5B65B4_npcdata_loword_house_or_other = -1;
|
|
1547 v120 = 0;
|
|
1548 v116 = 0;
|
|
1549 v111 = 0;
|
|
1550 v110 = 0;
|
|
1551 v109 = -1;
|
|
1552 v108 = 0;
|
|
1553 v107 = 0;
|
|
1554 pParty->sRotationX = v95;
|
|
1555 pParty->uFallSpeed = v134;
|
|
1556 dword_5B65C0 = 0;
|
|
1557 dword_5B65BC = 0;
|
|
1558 _5B65B8_npcdata_hiword_house_or_other = 0;
|
|
1559 _5B65B0_npcdata_rep_or_other = 0;
|
|
1560 _5B65AC_npcdata_fame_or_other = 0;
|
|
1561 _5B65A8_npcdata_uflags_or_other = 0;
|
|
1562 v106 = 232;
|
|
1563 LABEL_280:
|
|
1564 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
|
|
1565 }
|
|
1566 }
|
|
1567 else
|
|
1568 {
|
|
1569 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1);
|
|
1570 sub_44987B(v99, 0);
|
|
1571 v133 = 1;
|
|
1572 if ( pCurrentScreen == SCREEN_HOUSE )
|
|
1573 {
|
|
1574 if ( uGameState == 2 )
|
|
1575 {
|
|
1576 pAudioPlayer->StopChannels(-1, -1);
|
|
1577 dword_F8B19C = 0;
|
|
1578 while ( sub_4BD8B5() )
|
|
1579 ;
|
|
1580 pVideoPlayer->Unload();
|
|
1581 ptr_507BC0->Release();
|
|
1582 ptr_507BC0 = 0;
|
|
1583 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
1584 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
|
1585 pCurrentScreen = SCREEN_GAME;
|
|
1586 viewparams->bRedrawGameUI = 1;
|
|
1587 array_5913D8[6] = 0;
|
|
1588 pDialogueWindow->Release();
|
|
1589 dword_F8B19C = 0;
|
|
1590 pDialogueWindow = 0;
|
|
1591 pIcons_LOD->_40F9C5();
|
|
1592 }
|
|
1593 goto LABEL_302;
|
|
1594 }
|
|
1595 }
|
310
|
1596 ++curr_seq_num;
|
307
|
1597 //v4 = v124;
|
|
1598 //v5 = pSomeEVT;
|
|
1599 //v6 = v123;
|
|
1600 //v7 = "";
|
|
1601 break;
|
|
1602 case EVENT_PlaySound:
|
|
1603 v120 = 0;
|
|
1604 v116 = 0;
|
|
1605 v111 = 0;
|
|
1606 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
1607 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1608 v108 = 0;
|
|
1609 v107 = 0;
|
|
1610 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1611 goto LABEL_280;
|
|
1612 case EVENT_GiveItem:
|
|
1613 item.Reset();
|
|
1614 //v101 = &pSomeEVT[v9];
|
|
1615 v102 = _evt->v7
|
|
1616 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1617 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
|
|
1618 if ( v102 )
|
|
1619 item.uItemID = v102;
|
|
1620 pParty->SetHoldingItem(&item);
|
310
|
1621 ++curr_seq_num;
|
307
|
1622 //v4 = v124;
|
|
1623 //v5 = pSomeEVT;
|
|
1624 //v6 = v123;
|
|
1625 //v7 = "";
|
|
1626 break;
|
|
1627 case EVENT_SpeakInHouse:
|
|
1628 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1629 if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) )
|
|
1630 {
|
|
1631 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
|
|
1632 pRenderer->_49FD3A();
|
|
1633 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
|
|
1634 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
|
|
1635 v104 = 187;
|
|
1636 if ( uCurrentHouse_Animation != 167 )
|
|
1637 v104 = v103;
|
|
1638 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
|
|
1639 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
|
|
1640 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
|
|
1641 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
|
|
1642 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
|
|
1643 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
|
|
1644 }
|
310
|
1645 ++curr_seq_num;
|
307
|
1646 //v4 = v124;
|
|
1647 //v5 = pSomeEVT;
|
|
1648 //v6 = v123;
|
|
1649 //v7 = "";
|
|
1650 break;
|
|
1651 case EVENT_PressAnyKey:
|
|
1652 v121 = 33;
|
310
|
1653 v105 = curr_seq_num + 1;
|
307
|
1654 goto LABEL_295;
|
|
1655 case EVENT_Exit:
|
|
1656 goto LABEL_301;
|
|
1657 default:
|
310
|
1658 ++curr_seq_num;
|
307
|
1659 //v4 = v124;
|
|
1660 //v5 = pSomeEVT;
|
|
1661 //v6 = v123;
|
|
1662 //v7 = "";
|
|
1663 break;
|
|
1664 }
|
|
1665 }
|
|
1666 //++v4;
|
|
1667 //v124 = v4;
|
|
1668 //if ( v4 >= (signed int)uSomeEVT_NumEvents )
|
|
1669 //goto LABEL_301;
|
|
1670 //}
|
|
1671 }
|
|
1672 }
|
|
1673
|