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