Mercurial > mm7
comparison Events.cpp @ 336:ea55d6414029
Event_proceccor preliminary
author | Gloval |
---|---|
date | Thu, 21 Feb 2013 00:33:12 +0400 |
parents | 4c2cdda88562 |
children | edd2d8b7e3c4 |
comparison
equal
deleted
inserted
replaced
329:f76027321087 | 336:ea55d6414029 |
---|---|
120 void LoadLevel_InitializeLevelEvt() | 120 void LoadLevel_InitializeLevelEvt() |
121 { | 121 { |
122 if (!uLevelEVT_Size) | 122 if (!uLevelEVT_Size) |
123 return; | 123 return; |
124 | 124 |
125 memset(array_5B5928, 0, 3200); | 125 memset(array_5B5928_timers, 0, 3200); |
126 memset(pLevelEVT_Index, 80, 52800); | 126 memset(pLevelEVT_Index, 80, sizeof(EventIndex)*4400); |
127 | 127 |
128 uLevelEVT_NumEvents = 0; | 128 uLevelEVT_NumEvents = 0; |
129 dword_5B65C8 = 0; | 129 dword_5B65C8_timers_count = 0; |
130 | 130 |
131 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i) | 131 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i) |
132 { | 132 { |
133 pLevelEVT_Index[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8); | 133 pLevelEVT_Index[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8); |
134 pLevelEVT_Index[i].event_sequence_num = pLevelEVT[j + 3]; | 134 pLevelEVT_Index[i].event_sequence_num = pLevelEVT[j + 3]; |
141 | 141 |
142 //----- (0044684A) -------------------------------------------------------- | 142 //----- (0044684A) -------------------------------------------------------- |
143 void EventProcessor(int uEventID, int a2, int a3) | 143 void EventProcessor(int uEventID, int a2, int a3) |
144 { | 144 { |
145 unsigned int v3; // eax@5 | 145 unsigned int v3; // eax@5 |
146 //signed int v4; // esi@7 | 146 signed int v4; // esi@7 |
147 //char *v5; // eax@8 | 147 //char *v5; // eax@8 |
148 Player *v6; // ecx@8 | 148 Player *v6; // ecx@8 |
149 //char *v7; // ebp@8 | 149 //char *v7; // ebp@8 |
150 //signed int v8; // edx@10 | 150 //signed int v8; // edx@10 |
151 //int v9; // edi@12 | 151 //int v9; // edi@12 |
261 int v119; // [sp-4h] [bp-4ACh]@231 | 261 int v119; // [sp-4h] [bp-4ACh]@231 |
262 int v120; // [sp-4h] [bp-4ACh]@278 | 262 int v120; // [sp-4h] [bp-4ACh]@278 |
263 int v121; // [sp-4h] [bp-4ACh]@294 | 263 int v121; // [sp-4h] [bp-4ACh]@294 |
264 int curr_seq_num; // [sp+10h] [bp-498h]@4 | 264 int curr_seq_num; // [sp+10h] [bp-498h]@4 |
265 //char *v123; // [sp+14h] [bp-494h]@0 | 265 //char *v123; // [sp+14h] [bp-494h]@0 |
266 //signed int v124; // [sp+18h] [bp-490h]@7 | 266 signed int v124; // [sp+18h] [bp-490h]@7 |
267 signed int v125; // [sp+1Ch] [bp-48Ch]@155 | 267 signed int v125; // [sp+1Ch] [bp-48Ch]@155 |
268 int v126; // [sp+1Ch] [bp-48Ch]@262 | 268 int v126; // [sp+1Ch] [bp-48Ch]@262 |
269 int v127; // [sp+20h] [bp-488h]@4 | 269 int player_choose; // [sp+20h] [bp-488h]@4 |
270 int v128; // [sp+24h] [bp-484h]@21 | 270 int v128; // [sp+24h] [bp-484h]@21 |
271 int v129; // [sp+24h] [bp-484h]@262 | 271 int v129; // [sp+24h] [bp-484h]@262 |
272 signed int v130; // [sp+28h] [bp-480h]@0 | 272 signed int v130; // [sp+28h] [bp-480h]@0 |
273 //int v131; // [sp+2Ch] [bp-47Ch]@1 | 273 //int v131; // [sp+2Ch] [bp-47Ch]@1 |
274 int v132; // [sp+30h] [bp-478h]@262 | 274 int v132; // [sp+30h] [bp-478h]@262 |
292 { | 292 { |
293 if ( !GameUI_StatusBar_TimedStringTimeLeft ) | 293 if ( !GameUI_StatusBar_TimedStringTimeLeft ) |
294 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here | 294 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here |
295 return; | 295 return; |
296 } | 296 } |
297 v127 = 2 * (uActiveCharacter == 0) + 4; //4 and 6 | 297 player_choose = (uActiveCharacter == 0)?6:4; //4 - active or 6 - random player if active =0 |
298 curr_seq_num = dword_597F18; | 298 curr_seq_num = start_event_seq_number; |
299 if ( _5C3420_pDecoration ) | 299 if ( _5C3420_pDecoration ) |
300 { | 300 { |
301 uSomeEVT_NumEvents = uGlobalEVT_NumEvents; | 301 uSomeEVT_NumEvents = uGlobalEVT_NumEvents; |
302 pSomeEVT = pGlobalEVT; | 302 pSomeEVT = pGlobalEVT; |
303 memcpy(pSomeEVT_Events, pGlobalEVT_Index, 52800); //4400 evts | 303 memcpy(pSomeEVT_Events, pGlobalEVT_Index, sizeof(EventIndex)*4400); //4400 evts |
304 } | 304 } |
305 else | 305 else |
306 { | 306 { |
307 uSomeEVT_NumEvents = uLevelEVT_NumEvents; | 307 uSomeEVT_NumEvents = uLevelEVT_NumEvents; |
308 pSomeEVT = pLevelEVT; | 308 pSomeEVT = pLevelEVT; |
309 memcpy(pSomeEVT_Events, pLevelEVT_Index, 52800); | 309 memcpy(pSomeEVT_Events, pLevelEVT_Index, sizeof(EventIndex)*4400); |
310 } | 310 } |
311 | 311 |
312 | 312 |
313 //v4 = 0; | 313 v4 = 0; |
314 //v124 = 0; | 314 v124 = 0; |
315 for (uint i = 0; i < uSomeEVT_NumEvents; ++i) | 315 //for (uint i = 0; i < uSomeEVT_NumEvents; ++i) |
316 { | 316 // { |
317 //v5 = pSomeEVT; | 317 |
318 //v6 = v123; | 318 //v6 = v123; |
319 //v7 = ""; | 319 //v7 = ""; |
320 //while ( 1 ) | 320 while ( 1 ) |
321 //{ | 321 { |
322 if ( dword_5B65C4 ) | 322 if ( dword_5B65C4 ) |
323 goto LABEL_301; | 323 goto LABEL_301; |
324 //v8 = v4; | 324 //v8 = v4; |
325 if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].event_sequence_num == curr_seq_num ) | 325 if ( pSomeEVT_Events[v4].uEventID == uEventID && pSomeEVT_Events[v4].event_sequence_num == curr_seq_num ) |
326 { | 326 { |
327 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; | 327 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; |
328 //v10 = (ByteArray *)&v5[v9]; | 328 //v10 = (ByteArray *)&v5[v9]; |
329 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT); | 329 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT); |
330 | 330 |
331 switch (_evt->_e_type) | 331 switch (_evt->_e_type) |
332 { | 332 { |
333 case EVENT_CheckSeason: | 333 case EVENT_CheckSeason: |
334 // | |
334 if ( !sub_4465DF_check_season(_evt->v5) ) | 335 if ( !sub_4465DF_check_season(_evt->v5) ) |
335 { | 336 { |
336 ++curr_seq_num; | 337 ++curr_seq_num; |
337 //v4 = v124; | 338 v4 = v124; |
338 //v5 = pSomeEVT; | 339 |
339 //v6 = v123; | 340 //v6 = v123; |
340 //v7 = ""; | 341 //v7 = ""; |
341 break; | 342 break; |
342 } | 343 } |
343 v11 = _evt->v6; | 344 v124 = -1; |
344 goto LABEL_130; | 345 curr_seq_num = _evt->v6 - 1; |
346 ++curr_seq_num; | |
347 break; | |
345 case EVENT_ShowMovie: | 348 case EVENT_ShowMovie: |
346 { | 349 { |
347 strcpy(Source, (char *)&_evt->v7); | 350 strcpy(Source, (char *)&_evt->v7); |
348 v12 = (char *)&item.uExpireTime + strlen(Source) + 7; | 351 v12 = (char *)&item.uExpireTime + strlen(Source) + 7; |
349 if ( *v12 == 32 ) | 352 if ( *v12 == 32 ) |
378 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 381 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
379 } | 382 } |
380 if (pAsyncMouse) | 383 if (pAsyncMouse) |
381 pAsyncMouse->Resume(); | 384 pAsyncMouse->Resume(); |
382 ++curr_seq_num; | 385 ++curr_seq_num; |
383 //v4 = v124; | 386 v4 = v124; |
384 //v5 = pSomeEVT; | 387 |
385 //v6 = v123; | 388 //v6 = v123; |
386 //v7 = ""; | 389 //v7 = ""; |
387 break; | 390 break; |
388 } | 391 } |
389 if ( !_strcmpi(v16, "arbiter evil") ) | 392 if ( !_strcmpi(v16, "arbiter evil") ) |
401 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 404 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
402 } | 405 } |
403 if (pAsyncMouse) | 406 if (pAsyncMouse) |
404 pAsyncMouse->Resume(); | 407 pAsyncMouse->Resume(); |
405 ++curr_seq_num; | 408 ++curr_seq_num; |
406 //v4 = v124; | 409 v4 = v124; |
407 //v5 = pSomeEVT; | 410 |
408 //v6 = v123; | 411 //v6 = v123; |
409 //v7 = ""; | 412 //v7 = ""; |
410 | 413 |
411 break; | 414 break; |
412 } | 415 } |
425 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 428 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
426 } | 429 } |
427 if (pAsyncMouse) | 430 if (pAsyncMouse) |
428 pAsyncMouse->Resume(); | 431 pAsyncMouse->Resume(); |
429 ++curr_seq_num; | 432 ++curr_seq_num; |
430 //v4 = v124; | 433 v4 = v124; |
431 //v5 = pSomeEVT; | 434 |
432 //v6 = v123; | 435 //v6 = v123; |
433 //v7 = ""; | 436 //v7 = ""; |
434 } | 437 } |
435 break; | 438 break; |
436 case EVENT_CheckSkill: | 439 case EVENT_CheckSkill: |
437 { | 440 { |
438 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8); | 441 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8); |
439 if ( v127 < 0 ) | 442 if ( player_choose < 0 ) |
440 goto LABEL_47; | 443 goto LABEL_47; |
441 if ( v127 <= 3 ) | 444 if ( player_choose <= 3 ) |
442 { | 445 { |
443 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5]; | 446 v24 = pParty->pPlayers[0].pActiveSkills[3486 * player_choose + _evt->v5]; |
444 } | 447 } |
445 else | 448 else |
446 { | 449 { |
447 if ( v127 == 4 ) | 450 if ( player_choose == 4 ) |
448 { | 451 { |
449 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5]; | 452 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5]; |
450 } | 453 } |
451 else | 454 else |
452 { | 455 { |
453 if ( v127 == 5 ) | 456 if ( player_choose == 5 ) |
454 { | 457 { |
455 v20 = 0; | 458 v20 = 0; |
456 v21 = 3486 * v130 + _evt->v5; | 459 v21 = 3486 * v130 + _evt->v5; |
457 v136 = 1; | 460 v136 = 1; |
458 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21]; | 461 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21]; |
465 { | 468 { |
466 ++v20; | 469 ++v20; |
467 if ( v20 >= 4 ) | 470 if ( v20 >= 4 ) |
468 { | 471 { |
469 ++curr_seq_num; | 472 ++curr_seq_num; |
470 //v4 = v124; | 473 v4 = v124; |
471 //v5 = pSomeEVT; | 474 |
472 //v6 = v123; | 475 //v6 = v123; |
473 //v7 = ""; | 476 //v7 = ""; |
474 break; | 477 break; |
475 } | 478 } |
476 } | 479 } |
490 { | 493 { |
491 v11 = _evt->v11; | 494 v11 = _evt->v11; |
492 goto LABEL_130; | 495 goto LABEL_130; |
493 } | 496 } |
494 ++curr_seq_num; | 497 ++curr_seq_num; |
495 //v4 = v124; | 498 v4 = v124; |
496 //v5 = pSomeEVT; | 499 |
497 //v6 = v123; | 500 //v6 = v123; |
498 //v7 = ""; | 501 //v7 = ""; |
499 } | 502 } |
500 break; | 503 break; |
501 | 504 |
515 { | 518 { |
516 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 | 519 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 |
517 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); | 520 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); |
518 } | 521 } |
519 ++curr_seq_num; | 522 ++curr_seq_num; |
520 //v4 = v124; | 523 v4 = v124; |
521 //v5 = pSomeEVT; | 524 |
522 //v6 = v123; | 525 //v6 = v123; |
523 //v7 = ""; | 526 //v7 = ""; |
524 break; | 527 break; |
525 case EVENT_ChangeEvent: | 528 case EVENT_ChangeEvent: |
526 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); | 529 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); |
533 v26 = _5C3420_pDecoration; | 536 v26 = _5C3420_pDecoration; |
534 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0; | 537 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0; |
535 LOBYTE(v26->field_2) |= 0x20u; | 538 LOBYTE(v26->field_2) |= 0x20u; |
536 } | 539 } |
537 ++curr_seq_num; | 540 ++curr_seq_num; |
538 //v4 = v124; | 541 v4 = v124; |
539 //v5 = pSomeEVT; | 542 |
540 //v6 = v123; | 543 //v6 = v123; |
541 //v7 = ""; | 544 //v7 = ""; |
542 break; | 545 break; |
543 case EVENT_SetNPCGreeting: | 546 case EVENT_SetNPCGreeting: |
544 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 547 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); | 548 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); |
546 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; | 549 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; |
547 pNPCStats->pNewNPCData[v27].greet = v28; | 550 pNPCStats->pNewNPCData[v27].greet = v28; |
548 ++curr_seq_num; | 551 ++curr_seq_num; |
549 //v4 = v124; | 552 v4 = v124; |
550 //v5 = pSomeEVT; | 553 |
551 //v6 = v123; | 554 //v6 = v123; |
552 //v7 = ""; | 555 //v7 = ""; |
553 break; | 556 break; |
554 case EVENT_SetNPCTopic: | 557 case EVENT_SetNPCTopic: |
555 { | 558 { |
603 if ( v29 == 8 ) | 606 if ( v29 == 8 ) |
604 { | 607 { |
605 if ( v30 == 78 ) | 608 if ( v30 == 78 ) |
606 { | 609 { |
607 sub_4BD8B5(); | 610 sub_4BD8B5(); |
608 ptr_507BC0->Release(); | 611 window_SpeakInHouse->Release(); |
609 pParty->uFlags &= 0xFFFFFFFDu; | 612 pParty->uFlags &= 0xFFFFFFFDu; |
610 if ( EnterHouse((enum HOUSE_TYPE)170) ) | 613 if ( EnterHouse((enum HOUSE_TYPE)170) ) |
611 { | 614 { |
612 pAudioPlayer->StopChannels(-1, -1); | 615 pAudioPlayer->StopChannels(-1, -1); |
613 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); | 616 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); |
614 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | 617 window_SpeakInHouse->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); | 618 window_SpeakInHouse->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); | 619 window_SpeakInHouse->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); | 620 window_SpeakInHouse->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); | 621 window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); |
619 ptr_F8B1E8 = pNPCTopics[90].pText; | 622 ptr_F8B1E8 = pNPCTopics[90].pText; |
620 } | 623 } |
621 } | 624 } |
622 } | 625 } |
623 ++curr_seq_num; | 626 ++curr_seq_num; |
624 } | 627 } |
625 //v4 = v124; | 628 v4 = v124; |
626 //v5 = pSomeEVT; | 629 |
627 //v6 = v123; | 630 //v6 = v123; |
628 //v7 = ""; | 631 //v7 = ""; |
629 break; | 632 break; |
630 case EVENT_NPCSetItem: | 633 case EVENT_NPCSetItem: |
631 sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 634 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); | 635 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); |
633 ++curr_seq_num; | 636 ++curr_seq_num; |
634 //v4 = v124; | 637 v4 = v124; |
635 //v5 = pSomeEVT; | 638 |
636 //v6 = v123; | 639 //v6 = v123; |
637 //v7 = ""; | 640 //v7 = ""; |
638 break; | 641 break; |
639 case EVENT_SetActorItem: | 642 case EVENT_SetActorItem: |
640 Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 643 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); | 644 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); |
642 ++curr_seq_num; | 645 ++curr_seq_num; |
643 //v4 = v124; | 646 v4 = v124; |
644 //v5 = pSomeEVT; | 647 |
645 //v6 = v123; | 648 //v6 = v123; |
646 //v7 = ""; | 649 //v7 = ""; |
647 break; | 650 break; |
648 case EVENT_SetNPCGroupNews: | 651 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); | 652 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); |
650 ++curr_seq_num; | 653 ++curr_seq_num; |
651 //v4 = v124; | 654 v4 = v124; |
652 //v5 = pSomeEVT; | 655 |
653 //v6 = v123; | 656 //v6 = v123; |
654 //v7 = ""; | 657 //v7 = ""; |
655 break; | 658 break; |
656 case EVENT_SetActorGroup: | 659 case EVENT_SetActorGroup: |
657 __debugbreak(); | 660 __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); | 661 *(&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); |
659 ++curr_seq_num; | 662 ++curr_seq_num; |
660 //v4 = v124; | 663 v4 = v124; |
661 //v5 = pSomeEVT; | 664 |
662 //v6 = v123; | 665 //v6 = v123; |
663 //v7 = ""; | 666 //v7 = ""; |
664 break; | 667 break; |
665 case EVENT_ChangeGroup: | 668 case EVENT_ChangeGroup: |
666 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 669 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
678 --v40; | 681 --v40; |
679 } | 682 } |
680 while ( v40 ); | 683 while ( v40 ); |
681 } | 684 } |
682 ++curr_seq_num; | 685 ++curr_seq_num; |
683 //v4 = v124; | 686 v4 = v124; |
684 //v5 = pSomeEVT; | 687 |
685 //v6 = v123; | 688 //v6 = v123; |
686 //v7 = ""; | 689 //v7 = ""; |
687 break; | 690 break; |
688 case EVENT_ChangeGroupAlly: | 691 case EVENT_ChangeGroupAlly: |
689 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 692 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
701 --v44; | 704 --v44; |
702 } | 705 } |
703 while ( v44 ); | 706 while ( v44 ); |
704 } | 707 } |
705 ++curr_seq_num; | 708 ++curr_seq_num; |
706 //v4 = v124; | 709 v4 = v124; |
707 //v5 = pSomeEVT; | 710 |
708 //v6 = v123; | 711 //v6 = v123; |
709 //v7 = ""; | 712 //v7 = ""; |
710 break; | 713 break; |
711 case EVENT_MoveNPC: | 714 case EVENT_MoveNPC: |
712 { | 715 { |
713 | 716 |
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); | 717 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 ) | 718 if ( window_SpeakInHouse ) |
716 { | 719 { |
717 v46 = ptr_507BC0->ptr_1C; | 720 v46 = window_SpeakInHouse->ptr_1C; |
718 if ( v46 == (void *)165 ) | 721 if ( v46 == (void *)165 ) |
719 { | 722 { |
720 sub_4BD8B5(); | 723 sub_4BD8B5(); |
721 pVideoPlayer->Unload(); | 724 pVideoPlayer->Unload(); |
722 ptr_507BC0->Release(); | 725 window_SpeakInHouse->Release(); |
723 pParty->uFlags &= 0xFFFFFFFDu; | 726 pParty->uFlags &= 0xFFFFFFFDu; |
724 _5C3420_pDecoration = (LevelDecoration *)1; | 727 _5C3420_pDecoration = (LevelDecoration *)1; |
725 if ( EnterHouse((enum HOUSE_TYPE)165) ) | 728 if ( EnterHouse((enum HOUSE_TYPE)165) ) |
726 { | 729 { |
727 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); | 730 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); |
728 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); | 731 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); |
729 ptr_507BC0 = v47; | 732 window_SpeakInHouse = v47; |
730 v48 = v47->pControlsHead; | 733 v48 = v47->pControlsHead; |
731 if ( v48 ) | 734 if ( v48 ) |
732 { | 735 { |
733 do | 736 do |
734 { | 737 { |
735 v49 = v48->pNext; | 738 v49 = v48->pNext; |
736 pAllocator->FreeChunk(v48); | 739 pAllocator->FreeChunk(v48); |
737 v48 = v49; | 740 v48 = v49; |
738 } | 741 } |
739 while ( v49 ); | 742 while ( v49 ); |
740 v47 = ptr_507BC0; | 743 v47 = window_SpeakInHouse; |
741 } | 744 } |
742 v47->pControlsHead = 0; | 745 v47->pControlsHead = 0; |
743 ptr_507BC0->pControlsTail = 0; | 746 window_SpeakInHouse->pControlsTail = 0; |
744 ptr_507BC0->uNumControls = 0; | 747 window_SpeakInHouse->uNumControls = 0; |
745 } | 748 } |
746 } | 749 } |
747 else | 750 else |
748 { | 751 { |
749 if ( v46 == (void *)553 ) | 752 if ( v46 == (void *)553 ) |
750 pVideoPlayer->bLoopPlaying = 0; | 753 pVideoPlayer->bLoopPlaying = 0; |
751 } | 754 } |
752 } | 755 } |
753 ++curr_seq_num; | 756 ++curr_seq_num; |
754 } | 757 } |
755 //v4 = v124; | 758 v4 = v124; |
756 //v5 = pSomeEVT; | 759 |
757 //v6 = v123; | 760 //v6 = v123; |
758 //v7 = ""; | 761 //v7 = ""; |
759 break; | 762 break; |
760 case EVENT_Jmp: | 763 case EVENT_Jmp: |
761 //v124 = -1; | |
762 curr_seq_num = _evt->v5 - 1; | 764 curr_seq_num = _evt->v5 - 1; |
763 ++curr_seq_num; | 765 ++curr_seq_num; |
764 //v4 = v124; | 766 //v4 = -1; |
765 //v5 = pSomeEVT; | 767 |
766 //v6 = v123; | 768 //v6 = v123; |
767 //v7 = ""; | 769 //v7 = ""; |
768 break; | 770 break; |
769 case EVENT_ShowFace: | 771 case EVENT_ShowFace: |
770 v50 = _evt->v5; | 772 if ( _evt->v5 <= 3u ) //someone |
771 if ( (unsigned __int8)v50 <= 3u ) | 773 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); |
772 { | 774 else if ( _evt->v5 == 4 ) //active |
773 v117 = 0; | 775 pParty->pPlayers[uActiveCharacter].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); |
774 v113 = _evt->v6; | 776 else if ( _evt->v5 == 5 ) //all players |
775 v53 = (unsigned __int8)v50; | 777 { |
776 v52 = &pParty->pPlayers[v53]; | 778 for(int i=0; i<4; ++i) |
777 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); | 779 pParty->pPlayers[i].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); |
780 } | |
781 else //random player | |
782 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); | |
778 ++curr_seq_num; | 783 ++curr_seq_num; |
779 //v4 = v124; | 784 v4 = v124; |
780 //v5 = pSomeEVT; | 785 |
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); | |
791 ++curr_seq_num; | |
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); | |
805 ++curr_seq_num; | |
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: | |
820 ++curr_seq_num; | |
821 //v4 = v124; | |
822 //v5 = pSomeEVT; | |
823 //v6 = v123; | 786 //v6 = v123; |
824 //v7 = ""; | 787 //v7 = ""; |
825 break; | 788 break; |
826 case EVENT_CharacterAnimation: | 789 case EVENT_CharacterAnimation: |
827 v54 = _evt->v5; | 790 if ( _evt->v5 <= 3u ) //someone |
828 if ( (unsigned __int8)v54 <= 3u ) | 791 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0); |
829 { | 792 else if ( _evt->v5 == 4 ) //active |
830 v118 = 0; | 793 pParty->pPlayers[uActiveCharacter].PlaySound((PlayerSpeech) _evt->v6, 0); |
831 v114 = _evt->v6; | 794 else if ( _evt->v5 == 5 ) //all |
832 v57 = (unsigned __int8)v54; | 795 for(int i=0; i<4; ++i) |
833 goto LABEL_119; | 796 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0); |
834 } | 797 else //random |
835 if ( v54 == 4 ) | 798 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0); |
836 { | 799 ++curr_seq_num; |
837 v118 = 0; | 800 v4 = v124; |
838 v114 = _evt->v6; | 801 |
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); | |
851 ++curr_seq_num; | |
852 //v4 = v124; | |
853 //v5 = pSomeEVT; | |
854 //v6 = v123; | 802 //v6 = v123; |
855 //v7 = ""; | 803 //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 ); | |
865 ++curr_seq_num; | |
866 //v4 = v124; | |
867 //v5 = pSomeEVT; | |
868 //v6 = v123; | |
869 //v7 = ""; | |
870 break; | 804 break; |
871 case EVENT_ForPartyMember: | 805 case EVENT_ForPartyMember: |
872 v127 = _evt->v5; | 806 player_choose = _evt->v5; |
873 ++curr_seq_num; | 807 ++curr_seq_num; |
874 //v4 = v124; | 808 v4 = v124; |
875 //v5 = pSomeEVT; | 809 |
876 //v6 = v123; | 810 //v6 = v123; |
877 //v7 = ""; | 811 //v7 = ""; |
878 break; | 812 break; |
879 case EVENT_SummonItem: | 813 case EVENT_SummonItem: |
880 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 814 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), |
882 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8), | 816 _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), | 817 _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), | 818 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8), |
885 _evt->v25, _evt->v26, 0, 0); | 819 _evt->v25, _evt->v26, 0, 0); |
886 ++curr_seq_num; | 820 ++curr_seq_num; |
887 //v4 = v124; | 821 v4 = v124; |
888 //v5 = pSomeEVT; | 822 |
889 //v6 = v123; | 823 //v6 = v123; |
890 //v7 = ""; | 824 //v7 = ""; |
891 break; | 825 break; |
892 case EVENT_Compare: | 826 case EVENT_Compare: |
893 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | 827 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); |
894 if ( v127 == 5 ) | 828 if ( player_choose == 5 ) |
895 { | 829 { |
896 v130 = 0; | 830 v130 = 0; |
897 v59 = pParty->pPlayers; | 831 v59 = pParty->pPlayers; |
898 while ( 1 ) | 832 while ( 1 ) |
899 { | 833 { |
903 ++v130; | 837 ++v130; |
904 ++v59; | 838 ++v59; |
905 if ( (signed int)v59 >= (signed int)pParty->pHirelings ) | 839 if ( (signed int)v59 >= (signed int)pParty->pHirelings ) |
906 { | 840 { |
907 ++curr_seq_num; | 841 ++curr_seq_num; |
908 //v4 = v124; | 842 v4 = v124; |
909 //v5 = pSomeEVT; | 843 |
910 //v6 = v123; | 844 //v6 = v123; |
911 //v7 = ""; | 845 //v7 = ""; |
912 break; | 846 break; |
913 } | 847 } |
914 } | 848 } |
915 LABEL_129: | 849 LABEL_129: |
916 v11 = _evt->v11; | 850 v11 = _evt->v11; |
917 goto LABEL_130; | 851 goto LABEL_130; |
918 } | 852 } |
919 if ( v127 < 0 ) | 853 if ( player_choose < 0 ) |
920 goto LABEL_139; | 854 goto LABEL_139; |
921 v61 = v127; | 855 v61 = player_choose; |
922 if ( v127 <= 3 ) | 856 if ( player_choose <= 3 ) |
923 goto LABEL_137; | 857 goto LABEL_137; |
924 if ( v127 == 4 ) | 858 if ( player_choose == 4 ) |
925 { | 859 { |
926 if ( uActiveCharacter ) | 860 if ( uActiveCharacter ) |
927 { | 861 { |
928 v6 = pPlayers[uActiveCharacter]; | 862 v6 = pPlayers[uActiveCharacter]; |
929 goto LABEL_138; | 863 goto LABEL_138; |
930 } | 864 } |
931 } | 865 } |
932 else | 866 else |
933 { | 867 { |
934 if ( v127 != 6 ) | 868 if ( player_choose != 6 ) |
935 goto LABEL_139; | 869 goto LABEL_139; |
936 } | 870 } |
937 v61 = rand() % 4; | 871 v61 = rand() % 4; |
938 //v5 = pSomeEVT; | 872 |
939 LABEL_137: | 873 LABEL_137: |
940 v6 = &pParty->pPlayers[v61]; | 874 v6 = &pParty->pPlayers[v61]; |
941 LABEL_138: | 875 LABEL_138: |
942 //v123 = v6; | 876 //v123 = v6; |
943 LABEL_139: | 877 LABEL_139: |
946 v58); | 880 v58); |
947 LABEL_140: | 881 LABEL_140: |
948 if ( v62 ) | 882 if ( v62 ) |
949 goto LABEL_129; | 883 goto LABEL_129; |
950 ++curr_seq_num; | 884 ++curr_seq_num; |
951 //v4 = v124; | 885 v4 = v124; |
952 //v5 = pSomeEVT; | 886 |
953 //v6 = v123; | 887 //v6 = v123; |
954 //v7 = ""; | 888 //v7 = ""; |
955 break; | 889 break; |
956 case EVENT_IsActorAlive: | 890 case EVENT_IsActorAlive: |
957 v62 = IsActorAlive( | 891 v62 = IsActorAlive( |
966 v64 = 0; | 900 v64 = 0; |
967 if ( (void *)pParty->pPickedItem.uItemID == v63 ) | 901 if ( (void *)pParty->pPickedItem.uItemID == v63 ) |
968 { | 902 { |
969 pMouse->RemoveHoldingItem(); | 903 pMouse->RemoveHoldingItem(); |
970 ++curr_seq_num; | 904 ++curr_seq_num; |
971 //v4 = v124; | 905 v4 = v124; |
972 //v5 = pSomeEVT; | 906 |
973 //v6 = v123; | 907 //v6 = v123; |
974 //v7 = ""; | 908 //v7 = ""; |
975 break; | 909 break; |
976 } | 910 } |
977 v65 = 0; | 911 v65 = 0; |
981 { | 915 { |
982 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 ) | 916 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 ) |
983 { | 917 { |
984 v66->RemoveItemAtInventoryIndex(v65); | 918 v66->RemoveItemAtInventoryIndex(v65); |
985 ++curr_seq_num; | 919 ++curr_seq_num; |
986 //v4 = v124; | 920 v4 = v124; |
987 //v5 = pSomeEVT; | 921 |
988 //v6 = v123; | 922 //v6 = v123; |
989 //v7 = ""; | 923 //v7 = ""; |
990 break; | 924 break; |
991 } | 925 } |
992 ++v65; | 926 ++v65; |
999 { | 933 { |
1000 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 ) | 934 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 ) |
1001 { | 935 { |
1002 *(&v66->pEquipment.uOffHand + v68) = 0; | 936 *(&v66->pEquipment.uOffHand + v68) = 0; |
1003 ++curr_seq_num; | 937 ++curr_seq_num; |
1004 //v4 = v124; | 938 v4 = v124; |
1005 //v5 = pSomeEVT; | 939 |
1006 //v6 = v123; | 940 //v6 = v123; |
1007 //v7 = ""; | 941 //v7 = ""; |
1008 break; | 942 break; |
1009 } | 943 } |
1010 ++v68; | 944 ++v68; |
1047 LABEL_170: | 981 LABEL_170: |
1048 v125 += 4; | 982 v125 += 4; |
1049 if ( v125 > (signed int)&pPlayers[4] ) | 983 if ( v125 > (signed int)&pPlayers[4] ) |
1050 { | 984 { |
1051 ++curr_seq_num; | 985 ++curr_seq_num; |
1052 //v4 = v124; | 986 v4 = v124; |
1053 //v5 = pSomeEVT; | 987 |
1054 //v6 = v123; | 988 //v6 = v123; |
1055 //v7 = ""; | 989 //v7 = ""; |
1056 break; | 990 break; |
1057 } | 991 } |
1058 } | 992 } |
1059 } | 993 } |
1060 v75 = v127; | 994 v75 = player_choose; |
1061 if ( v127 != 5 ) | 995 if ( player_choose != 5 ) |
1062 { | 996 { |
1063 if ( v127 < 0 ) | 997 if ( player_choose < 0 ) |
1064 goto LABEL_183; | 998 goto LABEL_183; |
1065 if ( v127 > 3 ) | 999 if ( player_choose > 3 ) |
1066 { | 1000 { |
1067 if ( v127 != 4 ) | 1001 if ( player_choose != 4 ) |
1068 { | 1002 { |
1069 if ( v127 == 6 ) | 1003 if ( player_choose == 6 ) |
1070 goto LABEL_180; | 1004 goto LABEL_180; |
1071 LABEL_183: | 1005 LABEL_183: |
1072 ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); | 1006 ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); |
1073 ++curr_seq_num; | 1007 ++curr_seq_num; |
1074 //v4 = v124; | 1008 v4 = v124; |
1075 //v5 = pSomeEVT; | 1009 |
1076 //v6 = v123; | 1010 //v6 = v123; |
1077 //v7 = ""; | 1011 //v7 = ""; |
1078 break; | 1012 break; |
1079 } | 1013 } |
1080 if ( uActiveCharacter ) | 1014 if ( uActiveCharacter ) |
1082 v6 = pPlayers[uActiveCharacter]; | 1016 v6 = pPlayers[uActiveCharacter]; |
1083 goto LABEL_182; | 1017 goto LABEL_182; |
1084 } | 1018 } |
1085 LABEL_180: | 1019 LABEL_180: |
1086 v75 = rand() % 4; | 1020 v75 = rand() % 4; |
1087 //v5 = pSomeEVT; | 1021 |
1088 } | 1022 } |
1089 v6 = &pParty->pPlayers[v75]; | 1023 v6 = &pParty->pPlayers[v75]; |
1090 LABEL_182: | 1024 LABEL_182: |
1091 //v123 = v6; | 1025 //v123 = v6; |
1092 goto LABEL_183; | 1026 goto LABEL_183; |
1100 v63); | 1034 v63); |
1101 ++v76; | 1035 ++v76; |
1102 } | 1036 } |
1103 while ( (signed int)v76 < (signed int)pParty->pHirelings ); | 1037 while ( (signed int)v76 < (signed int)pParty->pHirelings ); |
1104 ++curr_seq_num; | 1038 ++curr_seq_num; |
1105 //v4 = v124; | 1039 v4 = v124; |
1106 //v5 = pSomeEVT; | 1040 |
1107 //v6 = v123; | 1041 //v6 = v123; |
1108 //v7 = ""; | 1042 //v7 = ""; |
1109 break; | 1043 break; |
1110 case EVENT_Set: | 1044 case EVENT_Set: |
1111 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | 1045 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); |
1112 v78 = v127; | 1046 v78 = player_choose; |
1113 if ( v127 != 5 ) | 1047 if ( player_choose != 5 ) |
1114 { | 1048 { |
1115 if ( v127 < 0 ) | 1049 if ( player_choose < 0 ) |
1116 goto LABEL_197; | 1050 goto LABEL_197; |
1117 if ( v127 > 3 ) | 1051 if ( player_choose > 3 ) |
1118 { | 1052 { |
1119 if ( v127 != 4 ) | 1053 if ( player_choose != 4 ) |
1120 { | 1054 { |
1121 if ( v127 == 6 ) | 1055 if ( player_choose == 6 ) |
1122 goto LABEL_194; | 1056 goto LABEL_194; |
1123 LABEL_197: | 1057 LABEL_197: |
1124 ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); | 1058 ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); |
1125 ++curr_seq_num; | 1059 ++curr_seq_num; |
1126 //v4 = v124; | 1060 v4 = v124; |
1127 //v5 = pSomeEVT; | 1061 |
1128 //v6 = v123; | 1062 //v6 = v123; |
1129 //v7 = ""; | 1063 //v7 = ""; |
1130 break; | 1064 break; |
1131 } | 1065 } |
1132 if ( uActiveCharacter ) | 1066 if ( uActiveCharacter ) |
1134 v6 = pPlayers[uActiveCharacter]; | 1068 v6 = pPlayers[uActiveCharacter]; |
1135 goto LABEL_196; | 1069 goto LABEL_196; |
1136 } | 1070 } |
1137 LABEL_194: | 1071 LABEL_194: |
1138 v78 = rand() % 4; | 1072 v78 = rand() % 4; |
1139 //v5 = pSomeEVT; | 1073 |
1140 } | 1074 } |
1141 v6 = &pParty->pPlayers[v78]; | 1075 v6 = &pParty->pPlayers[v78]; |
1142 LABEL_196: | 1076 LABEL_196: |
1143 //v123 = v6; | 1077 //v123 = v6; |
1144 goto LABEL_197; | 1078 goto LABEL_197; |
1152 v77); | 1086 v77); |
1153 ++v79; | 1087 ++v79; |
1154 } | 1088 } |
1155 while ( (signed int)v79 < (signed int)pParty->pHirelings ); | 1089 while ( (signed int)v79 < (signed int)pParty->pHirelings ); |
1156 ++curr_seq_num; | 1090 ++curr_seq_num; |
1157 //v4 = v124; | 1091 v4 = v124; |
1158 //v5 = pSomeEVT; | 1092 |
1159 //v6 = v123; | 1093 //v6 = v123; |
1160 //v7 = ""; | 1094 //v7 = ""; |
1161 break; | 1095 break; |
1162 case EVENT_Add: | 1096 case EVENT_Add: |
1163 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | 1097 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); |
1164 v81 = v127; | 1098 v81 = player_choose; |
1165 if ( v127 != 5 ) | 1099 if ( player_choose != 5 ) |
1166 { | 1100 { |
1167 if ( v127 < 0 ) | 1101 if ( player_choose < 0 ) |
1168 goto LABEL_211; | 1102 goto LABEL_211; |
1169 if ( v127 > 3 ) | 1103 if ( player_choose > 3 ) |
1170 { | 1104 { |
1171 if ( v127 != 4 ) | 1105 if ( player_choose != 4 ) |
1172 { | 1106 { |
1173 if ( v127 == 6 ) | 1107 if ( player_choose == 6 ) |
1174 goto LABEL_208; | 1108 goto LABEL_208; |
1175 LABEL_211: | 1109 LABEL_211: |
1176 ((Player *)v6)->AddVariable( | 1110 ((Player *)v6)->AddVariable( |
1177 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | 1111 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), |
1178 v80); | 1112 v80); |
1183 v6 = pPlayers[uActiveCharacter]; | 1117 v6 = pPlayers[uActiveCharacter]; |
1184 goto LABEL_210; | 1118 goto LABEL_210; |
1185 } | 1119 } |
1186 LABEL_208: | 1120 LABEL_208: |
1187 v81 = rand() % 4; | 1121 v81 = rand() % 4; |
1188 //v5 = pSomeEVT; | 1122 |
1189 } | 1123 } |
1190 v6 = &pParty->pPlayers[v81]; | 1124 v6 = &pParty->pPlayers[v81]; |
1191 LABEL_210: | 1125 LABEL_210: |
1192 //v123 = v6; | 1126 //v123 = v6; |
1193 goto LABEL_211; | 1127 goto LABEL_211; |
1205 LABEL_212: | 1139 LABEL_212: |
1206 v83 = _evt->v5 + ((uint)_evt->v6 << 8); | 1140 v83 = _evt->v5 + ((uint)_evt->v6 << 8); |
1207 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) | 1141 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) |
1208 viewparams->bRedrawGameUI = 1; | 1142 viewparams->bRedrawGameUI = 1; |
1209 ++curr_seq_num; | 1143 ++curr_seq_num; |
1210 //v4 = v124; | 1144 v4 = v124; |
1211 //v5 = pSomeEVT; | 1145 |
1212 //v6 = v123; | 1146 //v6 = v123; |
1213 //v7 = ""; | 1147 //v7 = ""; |
1214 break; | 1148 break; |
1215 case EVENT_InputString: | 1149 case EVENT_InputString: |
1216 if ( !dword_597F18 ) | 1150 if ( !start_event_seq_number ) |
1217 { | 1151 { |
1218 strcpy( | 1152 strcpy( |
1219 GameUI_StatusBar_TimedString, | 1153 GameUI_StatusBar_TimedString, |
1220 &pLevelStr[pLevelStrOffsets[_evt->v5 | 1154 &pLevelStr[pLevelStrOffsets[_evt->v5 |
1221 + ((_evt->v6 | 1155 + ((_evt->v6 |
1242 //v124 = -1; | 1176 //v124 = -1; |
1243 LABEL_131: | 1177 LABEL_131: |
1244 curr_seq_num = v11 - 1; | 1178 curr_seq_num = v11 - 1; |
1245 } | 1179 } |
1246 ++curr_seq_num; | 1180 ++curr_seq_num; |
1247 //v4 = v124; | 1181 v4 = v124; |
1248 //v5 = pSomeEVT; | 1182 |
1249 //v6 = v123; | 1183 //v6 = v123; |
1250 //v7 = ""; | 1184 //v7 = ""; |
1251 break; | 1185 break; |
1252 case EVENT_RandomGoTo: | 1186 case EVENT_RandomGoTo: |
1253 //v124 = -1; | 1187 //v124 = -1; |
1267 if ( v86 == 4 ) | 1201 if ( v86 == 4 ) |
1268 { | 1202 { |
1269 if ( !uActiveCharacter ) | 1203 if ( !uActiveCharacter ) |
1270 { | 1204 { |
1271 ++curr_seq_num; | 1205 ++curr_seq_num; |
1272 //v4 = v124; | 1206 v4 = v124; |
1273 //v5 = pSomeEVT; | 1207 |
1274 //v6 = v123; | 1208 //v6 = v123; |
1275 //v7 = ""; | 1209 //v7 = ""; |
1276 break; | 1210 break; |
1277 } | 1211 } |
1278 v119 = _evt->v6; | 1212 v119 = _evt->v6; |
1288 LABEL_233: | 1222 LABEL_233: |
1289 v88 = &pParty->pPlayers[v89]; | 1223 v88 = &pParty->pPlayers[v89]; |
1290 LABEL_234: | 1224 LABEL_234: |
1291 v88->ReceiveDamage(v115, v119); | 1225 v88->ReceiveDamage(v115, v119); |
1292 ++curr_seq_num; | 1226 ++curr_seq_num; |
1293 //v4 = v124; | 1227 v4 = v124; |
1294 //v5 = pSomeEVT; | 1228 |
1295 //v6 = v123; | 1229 //v6 = v123; |
1296 //v7 = ""; | 1230 //v7 = ""; |
1297 break; | 1231 break; |
1298 } | 1232 } |
1299 v87 = pParty->pPlayers; | 1233 v87 = pParty->pPlayers; |
1302 v87->ReceiveDamage(v85, _evt->v6); | 1236 v87->ReceiveDamage(v85, _evt->v6); |
1303 ++v87; | 1237 ++v87; |
1304 } | 1238 } |
1305 while ( (signed int)v87 < (signed int)pParty->pHirelings ); | 1239 while ( (signed int)v87 < (signed int)pParty->pHirelings ); |
1306 ++curr_seq_num; | 1240 ++curr_seq_num; |
1307 //v4 = v124; | 1241 v4 = v124; |
1308 //v5 = pSomeEVT; | 1242 |
1309 //v6 = v123; | 1243 //v6 = v123; |
1310 //v7 = ""; | 1244 //v7 = ""; |
1311 break; | 1245 break; |
1312 case EVENT_ToggleIndoorLight: | 1246 case EVENT_ToggleIndoorLight: |
1313 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); | 1247 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); |
1314 ++curr_seq_num; | 1248 ++curr_seq_num; |
1315 //v4 = v124; | 1249 v4 = v124; |
1316 //v5 = pSomeEVT; | 1250 |
1317 //v6 = v123; | 1251 //v6 = v123; |
1318 //v7 = ""; | 1252 //v7 = ""; |
1319 break; | 1253 break; |
1320 case EVENT_SetFacesBit: | 1254 case EVENT_SetFacesBit: |
1321 sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 1255 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); | 1256 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); |
1323 ++curr_seq_num; | 1257 ++curr_seq_num; |
1324 //v4 = v124; | 1258 v4 = v124; |
1325 //v5 = pSomeEVT; | 1259 |
1326 //v6 = v123; | 1260 //v6 = v123; |
1327 //v7 = ""; | 1261 //v7 = ""; |
1328 break; | 1262 break; |
1329 case EVENT_ToggleChestFlag: | 1263 case EVENT_ToggleChestFlag: |
1330 Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 1264 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); | 1265 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); |
1332 ++curr_seq_num; | 1266 ++curr_seq_num; |
1333 //v4 = v124; | 1267 v4 = v124; |
1334 //v5 = pSomeEVT; | 1268 |
1335 //v6 = v123; | 1269 //v6 = v123; |
1336 //v7 = ""; | 1270 //v7 = ""; |
1337 break; | 1271 break; |
1338 case EVENT_ToggleActorFlag: | 1272 case EVENT_ToggleActorFlag: |
1339 Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 1273 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); | 1274 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); |
1341 ++curr_seq_num; | 1275 ++curr_seq_num; |
1342 //v4 = v124; | 1276 v4 = v124; |
1343 //v5 = pSomeEVT; | 1277 |
1344 //v6 = v123; | 1278 //v6 = v123; |
1345 //v7 = ""; | 1279 //v7 = ""; |
1346 break; | 1280 break; |
1347 case EVENT_ToggleActorGroupFlag: | 1281 case EVENT_ToggleActorGroupFlag: |
1348 ToggleActorGroupFlag( | 1282 ToggleActorGroupFlag( |
1349 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | 1283 _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), | 1284 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), |
1351 _evt->v13); | 1285 _evt->v13); |
1352 ++curr_seq_num; | 1286 ++curr_seq_num; |
1353 //v4 = v124; | 1287 v4 = v124; |
1354 //v5 = pSomeEVT; | 1288 |
1355 //v6 = v123; | 1289 //v6 = v123; |
1356 //v7 = ""; | 1290 //v7 = ""; |
1357 break; | 1291 break; |
1358 case EVENT_SetSnow: | 1292 case EVENT_SetSnow: |
1359 if ( !_evt->v5 ) | 1293 if ( !_evt->v5 ) |
1360 pWeather->bRenderSnow = _evt->v6 != 0; | 1294 pWeather->bRenderSnow = _evt->v6 != 0; |
1361 ++curr_seq_num; | 1295 ++curr_seq_num; |
1362 //v4 = v124; | 1296 v4 = v124; |
1363 //v5 = pSomeEVT; | 1297 |
1364 //v6 = v123; | 1298 //v6 = v123; |
1365 //v7 = ""; | 1299 //v7 = ""; |
1366 break; | 1300 break; |
1367 case EVENT_StatusText: | 1301 case EVENT_StatusText: |
1368 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 1302 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
1370 { | 1304 { |
1371 if ( _5C3420_pDecoration == (LevelDecoration *)1 ) | 1305 if ( _5C3420_pDecoration == (LevelDecoration *)1 ) |
1372 { | 1306 { |
1373 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; | 1307 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; |
1374 ++curr_seq_num; | 1308 ++curr_seq_num; |
1375 //v4 = v124; | 1309 v4 = v124; |
1376 //v5 = pSomeEVT; | 1310 |
1377 //v6 = v123; | 1311 //v6 = v123; |
1378 //v7 = ""; | 1312 //v7 = ""; |
1379 break; | 1313 break; |
1380 } | 1314 } |
1381 if ( a3 == 1 ) | 1315 if ( a3 == 1 ) |
1382 { | 1316 { |
1383 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; | 1317 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; |
1384 //LABEL_248: | 1318 //LABEL_248: |
1385 ShowStatusBarString(v91, 2u); | 1319 ShowStatusBarString(v91, 2u); |
1386 ++curr_seq_num; | 1320 ++curr_seq_num; |
1387 //v4 = v124; | 1321 v4 = v124; |
1388 //v5 = pSomeEVT; | 1322 |
1389 //v6 = v123; | 1323 //v6 = v123; |
1390 //v7 = ""; | 1324 //v7 = ""; |
1391 break; | 1325 break; |
1392 } | 1326 } |
1393 } | 1327 } |
1396 if ( a3 == 1 ) | 1330 if ( a3 == 1 ) |
1397 { | 1331 { |
1398 v91 = &pLevelStr[pLevelStrOffsets[v90]]; | 1332 v91 = &pLevelStr[pLevelStrOffsets[v90]]; |
1399 ShowStatusBarString(v91, 2u); | 1333 ShowStatusBarString(v91, 2u); |
1400 ++curr_seq_num; | 1334 ++curr_seq_num; |
1401 //v4 = v124; | 1335 v4 = v124; |
1402 //v5 = pSomeEVT; | 1336 |
1403 //v6 = v123; | 1337 //v6 = v123; |
1404 //v7 = ""; | 1338 //v7 = ""; |
1405 break; | 1339 break; |
1406 } | 1340 } |
1407 } | 1341 } |
1408 ++curr_seq_num; | 1342 ++curr_seq_num; |
1409 //v4 = v124; | 1343 v4 = v124; |
1410 //v5 = pSomeEVT; | 1344 |
1411 //v6 = v123; | 1345 //v6 = v123; |
1412 //v7 = ""; | 1346 //v7 = ""; |
1413 break; | 1347 break; |
1414 case EVENT_ShowMessage: | 1348 case EVENT_ShowMessage: |
1415 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 1349 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
1422 else | 1356 else |
1423 { | 1357 { |
1424 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]); | 1358 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]); |
1425 } | 1359 } |
1426 ++curr_seq_num; | 1360 ++curr_seq_num; |
1427 //v4 = v124; | 1361 v4 = v124; |
1428 //v5 = pSomeEVT; | 1362 |
1429 //v6 = v123; | 1363 //v6 = v123; |
1430 //v7 = ""; | 1364 //v7 = ""; |
1431 break; | 1365 break; |
1432 case EVENT_CastSpell: | 1366 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), | 1367 sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), |
1435 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), | 1369 _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), | 1370 _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), | 1371 _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)); | 1372 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8)); |
1439 ++curr_seq_num; | 1373 ++curr_seq_num; |
1440 //v4 = v124; | 1374 v4 = v124; |
1441 //v5 = pSomeEVT; | 1375 |
1442 //v6 = v123; | 1376 //v6 = v123; |
1443 //v7 = ""; | 1377 //v7 = ""; |
1444 break; | 1378 break; |
1445 case EVENT_SetTexture: | 1379 case EVENT_SetTexture: |
1446 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); | 1380 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); |
1447 ++curr_seq_num; | 1381 ++curr_seq_num; |
1448 //v4 = v124; | 1382 v4 = v124; |
1449 //v5 = pSomeEVT; | 1383 |
1450 //v6 = v123; | 1384 //v6 = v123; |
1451 //v7 = ""; | 1385 //v7 = ""; |
1452 break; | 1386 break; |
1453 case EVENT_SetSprite: | 1387 case EVENT_SetSprite: |
1454 SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); | 1388 SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); |
1455 ++curr_seq_num; | 1389 ++curr_seq_num; |
1456 //v4 = v124; | 1390 v4 = v124; |
1457 //v5 = pSomeEVT; | 1391 |
1458 //v6 = v123; | 1392 //v6 = v123; |
1459 //v7 = ""; | 1393 //v7 = ""; |
1460 break; | 1394 break; |
1461 case EVENT_SummonMonsters: | 1395 case EVENT_SummonMonsters: |
1462 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7, | 1396 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7, |
1464 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), | 1398 _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), | 1399 _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), | 1400 _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)); | 1401 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8)); |
1468 ++curr_seq_num; | 1402 ++curr_seq_num; |
1469 //v4 = v124; | 1403 v4 = v124; |
1470 //v5 = pSomeEVT; | 1404 |
1471 //v6 = v123; | 1405 //v6 = v123; |
1472 //v7 = ""; | 1406 //v7 = ""; |
1473 break; | 1407 break; |
1474 case EVENT_MouseOver: | 1408 case EVENT_MouseOver: |
1475 case EVENT_LocationName: | 1409 case EVENT_LocationName: |
1476 --curr_seq_num; | 1410 --curr_seq_num; |
1477 ++curr_seq_num; | 1411 ++curr_seq_num; |
1478 //v4 = v124; | 1412 v4 = v124; |
1479 //v5 = pSomeEVT; | 1413 |
1480 //v6 = v123; | 1414 //v6 = v123; |
1481 //v7 = ""; | 1415 //v7 = ""; |
1482 break; | 1416 break; |
1483 case EVENT_ChangeDoorState: | 1417 case EVENT_ChangeDoorState: |
1484 sub_449A49_door_switch_animation(_evt->v5, _evt->v6); | 1418 sub_449A49_door_switch_animation(_evt->v5, _evt->v6); |
1485 ++curr_seq_num; | 1419 ++curr_seq_num; |
1486 //v4 = v124; | 1420 v4 = v124; |
1487 //v5 = pSomeEVT; | 1421 |
1488 //v6 = v123; | 1422 //v6 = v123; |
1489 //v7 = ""; | 1423 //v7 = ""; |
1490 break; | 1424 break; |
1491 case EVENT_OpenChest: | 1425 case EVENT_OpenChest: |
1492 if ( !Chest::Open(_evt->v5) ) | 1426 if ( !Chest::Open(_evt->v5) ) |
1493 goto LABEL_301; | 1427 goto LABEL_301; |
1494 ++curr_seq_num; | 1428 ++curr_seq_num; |
1495 //v4 = v124; | 1429 v4 = v124; |
1496 //v5 = pSomeEVT; | 1430 |
1497 //v6 = v123; | 1431 //v6 = v123; |
1498 //v7 = ""; | 1432 //v7 = ""; |
1499 break; | 1433 break; |
1500 case EVENT_MoveToMap: | 1434 case EVENT_MoveToMap: |
1501 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | 1435 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
1576 pAudioPlayer->StopChannels(-1, -1); | 1510 pAudioPlayer->StopChannels(-1, -1); |
1577 dword_F8B19C = 0; | 1511 dword_F8B19C = 0; |
1578 while ( sub_4BD8B5() ) | 1512 while ( sub_4BD8B5() ) |
1579 ; | 1513 ; |
1580 pVideoPlayer->Unload(); | 1514 pVideoPlayer->Unload(); |
1581 ptr_507BC0->Release(); | 1515 window_SpeakInHouse->Release(); |
1582 ptr_507BC0 = 0; | 1516 window_SpeakInHouse = 0; |
1583 if ( pMessageQueue_50CBD0->uNumMessages ) | 1517 if ( pMessageQueue_50CBD0->uNumMessages ) |
1584 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1518 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1585 pCurrentScreen = SCREEN_GAME; | 1519 pCurrentScreen = SCREEN_GAME; |
1586 viewparams->bRedrawGameUI = 1; | 1520 viewparams->bRedrawGameUI = 1; |
1587 array_5913D8[6] = 0; | 1521 array_5913D8[6] = 0; |
1592 } | 1526 } |
1593 goto LABEL_302; | 1527 goto LABEL_302; |
1594 } | 1528 } |
1595 } | 1529 } |
1596 ++curr_seq_num; | 1530 ++curr_seq_num; |
1597 //v4 = v124; | 1531 v4 = v124; |
1598 //v5 = pSomeEVT; | 1532 |
1599 //v6 = v123; | 1533 //v6 = v123; |
1600 //v7 = ""; | 1534 //v7 = ""; |
1601 break; | 1535 break; |
1602 case EVENT_PlaySound: | 1536 case EVENT_PlaySound: |
1603 v120 = 0; | 1537 v120 = 0; |
1617 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item); | 1551 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item); |
1618 if ( v102 ) | 1552 if ( v102 ) |
1619 item.uItemID = v102; | 1553 item.uItemID = v102; |
1620 pParty->SetHoldingItem(&item); | 1554 pParty->SetHoldingItem(&item); |
1621 ++curr_seq_num; | 1555 ++curr_seq_num; |
1622 //v4 = v124; | 1556 v4 = v124; |
1623 //v5 = pSomeEVT; | 1557 |
1624 //v6 = v123; | 1558 //v6 = v123; |
1625 //v7 = ""; | 1559 //v7 = ""; |
1626 break; | 1560 break; |
1627 case EVENT_SpeakInHouse: | 1561 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))) ) | 1562 if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) ) |
1630 { | 1563 { |
1631 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) | 1564 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) |
1632 pRenderer->_49FD3A(); | 1565 pRenderer->_49FD3A(); |
1633 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); | 1566 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); |
1634 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0); | 1567 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0); |
1635 v104 = 187; | 1568 v104 = 187; |
1636 if ( uCurrentHouse_Animation != 167 ) | 1569 if ( uCurrentHouse_Animation != 167 ) |
1637 v104 = v103; | 1570 v104 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); |
1638 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); | 1571 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); |
1639 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | 1572 window_SpeakInHouse->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); | 1573 window_SpeakInHouse->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); | 1574 window_SpeakInHouse->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); | 1575 window_SpeakInHouse->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); | 1576 window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); |
1644 } | 1577 } |
1645 ++curr_seq_num; | 1578 ++curr_seq_num; |
1646 //v4 = v124; | 1579 v4 = v124; |
1647 //v5 = pSomeEVT; | 1580 |
1648 //v6 = v123; | 1581 //v6 = v123; |
1649 //v7 = ""; | 1582 //v7 = ""; |
1650 break; | 1583 break; |
1651 case EVENT_PressAnyKey: | 1584 case EVENT_PressAnyKey: |
1652 v121 = 33; | 1585 v121 = 33; |
1654 goto LABEL_295; | 1587 goto LABEL_295; |
1655 case EVENT_Exit: | 1588 case EVENT_Exit: |
1656 goto LABEL_301; | 1589 goto LABEL_301; |
1657 default: | 1590 default: |
1658 ++curr_seq_num; | 1591 ++curr_seq_num; |
1659 //v4 = v124; | 1592 v4 = v124; |
1660 //v5 = pSomeEVT; | 1593 |
1661 //v6 = v123; | 1594 //v6 = v123; |
1662 //v7 = ""; | 1595 //v7 = ""; |
1663 break; | 1596 break; |
1664 } | 1597 } |
1665 } | 1598 } |
1666 //++v4; | 1599 ++v4; |
1667 //v124 = v4; | 1600 v124 = v4; |
1668 //if ( v4 >= (signed int)uSomeEVT_NumEvents ) | 1601 if ( v4 >= uSomeEVT_NumEvents ) |
1669 //goto LABEL_301; | 1602 goto LABEL_301; |
1670 //} | 1603 //} |
1671 } | 1604 } |
1672 } | 1605 } |
1673 | 1606 |