comparison Events.cpp @ 525:e7b3fa10d58d

events cleanup
author Gloval
date Sat, 02 Mar 2013 15:38:49 +0400
parents 35f28d4c0ff9
children d6711da258f1
comparison
equal deleted inserted replaced
524:5196a51cc9ec 525:e7b3fa10d58d
336 // 336 //
337 if ( !sub_4465DF_check_season(_evt->v5) ) 337 if ( !sub_4465DF_check_season(_evt->v5) )
338 { 338 {
339 ++curr_seq_num; 339 ++curr_seq_num;
340 v4 = v124; 340 v4 = v124;
341
342 //v6 = v123;
343 //v7 = "";
344 break; 341 break;
345 } 342 }
346 v124 = -1; 343 v124 = -1;
347 curr_seq_num = _evt->v6 - 1; 344 curr_seq_num = _evt->v6 - 1;
348 ++curr_seq_num; 345 ++curr_seq_num;
531 } 528 }
532 else 529 else
533 { 530 {
534 v26 = (LevelDecoration *)activeLevelDecoration; 531 v26 = (LevelDecoration *)activeLevelDecoration;
535 stru_5E4C90._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0; 532 stru_5E4C90._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0;
536 LOBYTE(v26->field_2) |= 0x20u; 533 v26->field_2 |= 0x0020;
537 } 534 }
538 ++curr_seq_num; 535 ++curr_seq_num;
539 v4 = v124; 536 v4 = v124;
540 537
541 //v6 = v123;
542 //v7 = "";
543 break; 538 break;
544 case EVENT_SetNPCGreeting: 539 case EVENT_SetNPCGreeting:
545 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); 540 v27 = EVT_DWORD(_evt->v5);
546 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
547 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; 541 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
548 pNPCStats->pNewNPCData[v27].greet = v28; 542 pNPCStats->pNewNPCData[v27].greet = EVT_DWORD(_evt->v9);
549 ++curr_seq_num; 543 ++curr_seq_num;
550 v4 = v124; 544 v4 = v124;
551 545
552 //v6 = v123; 546 //v6 = v123;
553 //v7 = ""; 547 //v7 = "";
627 621
628 //v6 = v123; 622 //v6 = v123;
629 //v7 = ""; 623 //v7 = "";
630 break; 624 break;
631 case EVENT_NPCSetItem: 625 case EVENT_NPCSetItem:
632 sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 626 sub_448518_npc_set_item(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
633 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); 627 ++curr_seq_num;
634 ++curr_seq_num; 628 v4 = v124;
635 v4 = v124; 629
636
637 //v6 = v123;
638 //v7 = "";
639 break; 630 break;
640 case EVENT_SetActorItem: 631 case EVENT_SetActorItem:
641 Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 632 Actor::GiveItem(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
642 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); 633 ++curr_seq_num;
643 ++curr_seq_num; 634 v4 = v124;
644 v4 = v124;
645
646 //v6 = v123;
647 //v7 = "";
648 break; 635 break;
649 case EVENT_SetNPCGroupNews: 636 case EVENT_SetNPCGroupNews:
650 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); 637 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
651 ++curr_seq_num; 638 ++curr_seq_num;
652 v4 = v124; 639 v4 = v124;
653
654 //v6 = v123;
655 //v7 = "";
656 break; 640 break;
657 case EVENT_SetActorGroup: 641 case EVENT_SetActorGroup:
658 __debugbreak(); 642 __debugbreak();
659 *(&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); 643 *(&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);
660 ++curr_seq_num; 644 ++curr_seq_num;
661 v4 = v124; 645 v4 = v124;
662
663 //v6 = v123;
664 //v7 = "";
665 break; 646 break;
666 case EVENT_ChangeGroup: 647 case EVENT_ChangeGroup:
667 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); 648 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
668 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); 649 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
669 v40 = uNumActors; 650 v40 = uNumActors;
710 //v7 = ""; 691 //v7 = "";
711 break; 692 break;
712 case EVENT_MoveNPC: 693 case EVENT_MoveNPC:
713 { 694 {
714 695
715 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); 696 pNPCStats->pNewNPCData[EVT_DWORD(_evt->v5)].Location2D =EVT_DWORD(_evt->v9);
716 if ( window_SpeakInHouse ) 697 if ( window_SpeakInHouse )
717 { 698 {
718 v46 = window_SpeakInHouse->ptr_1C; 699
719 if ( v46 == (void *)165 ) 700 if ( window_SpeakInHouse->par1C == 165 )
720 { 701 {
721 sub_4BD8B5(); 702 sub_4BD8B5();
722 pVideoPlayer->Unload(); 703 pVideoPlayer->Unload();
723 window_SpeakInHouse->Release(); 704 window_SpeakInHouse->Release();
724 pParty->uFlags &= 0xFFFFFFFDu; 705 pParty->uFlags &= 0xFFFFFFFDu;
725 activeLevelDecoration = (LevelDecoration*)1; 706 activeLevelDecoration = (LevelDecoration*)1;
726 if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) ) 707 if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
727 { 708 {
728 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); 709 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
729 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); 710 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
730 window_SpeakInHouse = v47; 711 v48 = window_SpeakInHouse->pControlsHead;
731 v48 = v47->pControlsHead;
732 if ( v48 ) 712 if ( v48 )
733 { 713 {
734 do 714 do
735 { 715 {
736 v49 = v48->pNext; 716 v49 = v48->pNext;
737 pAllocator->FreeChunk(v48); 717 pAllocator->FreeChunk(v48);
738 v48 = v49; 718 v48 = v49;
739 } 719 }
740 while ( v49 ); 720 while ( v49 );
741 v47 = window_SpeakInHouse;
742 } 721 }
743 v47->pControlsHead = 0; 722 window_SpeakInHouse->pControlsHead = 0;
744 window_SpeakInHouse->pControlsTail = 0; 723 window_SpeakInHouse->pControlsTail = 0;
745 window_SpeakInHouse->uNumControls = 0; 724 window_SpeakInHouse->uNumControls = 0;
746 } 725 }
747 } 726 }
748 else 727 else
749 { 728 {
750 if ( v46 == (void *)553 ) 729 if ( window_SpeakInHouse->par1C == 553 )
751 pVideoPlayer->bLoopPlaying = 0; 730 pVideoPlayer->bLoopPlaying = 0;
752 } 731 }
753 } 732 }
754 ++curr_seq_num; 733
755 } 734 }
756 v4 = v124; 735 ++curr_seq_num;
757 736 v4 = v124;
758 //v6 = v123; 737
759 //v7 = "";
760 break; 738 break;
761 case EVENT_Jmp: 739 case EVENT_Jmp:
762 curr_seq_num = _evt->v5 - 1; 740 curr_seq_num = _evt->v5 - 1;
763 ++curr_seq_num; 741 ++curr_seq_num;
764 //v4 = -1; 742 v4 = -1;
765 743
766 //v6 = v123;
767 //v7 = "";
768 break; 744 break;
769 case EVENT_ShowFace: 745 case EVENT_ShowFace:
770 if ( _evt->v5 <= 3u ) //someone 746 if ( _evt->v5 <= 3u ) //someone
771 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); 747 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
772 else if ( _evt->v5 == 4 ) //active 748 else if ( _evt->v5 == 4 ) //active
778 } 754 }
779 else //random player 755 else //random player
780 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); 756 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
781 ++curr_seq_num; 757 ++curr_seq_num;
782 v4 = v124; 758 v4 = v124;
783 759
784 //v6 = v123;
785 //v7 = "";
786 break; 760 break;
787 case EVENT_CharacterAnimation: 761 case EVENT_CharacterAnimation:
788 if ( _evt->v5 <= 3u ) //someone 762 if ( _evt->v5 <= 3u ) //someone
789 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0); 763 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0);
790 else if ( _evt->v5 == 4 ) //active 764 else if ( _evt->v5 == 4 ) //active
793 for(int i=0; i<4; ++i) 767 for(int i=0; i<4; ++i)
794 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0); 768 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0);
795 else //random 769 else //random
796 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0); 770 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0);
797 ++curr_seq_num; 771 ++curr_seq_num;
798 v4 = v124; 772 v4 = v124;
799 773
800 //v6 = v123;
801 //v7 = "";
802 break; 774 break;
803 case EVENT_ForPartyMember: 775 case EVENT_ForPartyMember:
804 player_choose = _evt->v5; 776 player_choose = _evt->v5;
805 ++curr_seq_num; 777 ++curr_seq_num;
806 v4 = v124; 778 v4 = v124;
807
808 //v6 = v123;
809 //v7 = "";
810 break; 779 break;
811 case EVENT_SummonItem: 780 case EVENT_SummonItem:
812 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 781 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
813 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), 782 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
814 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8), 783 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
864 curr_seq_num = _evt->v11 - 1; 833 curr_seq_num = _evt->v11 - 1;
865 } 834 }
866 } 835 }
867 ++curr_seq_num; 836 ++curr_seq_num;
868 v4 = v124; 837 v4 = v124;
869 //v6 = v123;
870 //v7 = "";
871 break; 838 break;
872 case EVENT_IsActorAlive: 839 case EVENT_IsActorAlive:
873 if (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10))) 840 if (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10)))
874 { 841 {
875 v124 = -1; 842 v124 = -1;
977 } 944 }
978 if ( player_choose <= 3 ) 945 if ( player_choose <= 3 )
979 { 946 {
980 pPlayer = &pParty->pPlayers[player_choose]; 947 pPlayer = &pParty->pPlayers[player_choose];
981 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 948 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
982 ++curr_seq_num;
983 v4 = v124;
984 break;
985 } 949 }
986 else if ( player_choose == 4 ) //active 950 else if ( player_choose == 4 ) //active
987 { 951 {
988 if ( uActiveCharacter ) 952 if ( uActiveCharacter )
989 { 953 {
990 pPlayer = pPlayers[uActiveCharacter]; 954 pPlayer = pPlayers[uActiveCharacter];
991 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 955 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
992 ++curr_seq_num;
993 v4 = v124;
994 break;
995 } 956 }
996 } 957 }
997 else if ( player_choose == 5 )//all 958 else if ( player_choose == 5 )//all
998 { 959 {
999 v130 = 0; 960 v130 = 0;
1004 ++curr_seq_num; 965 ++curr_seq_num;
1005 break; 966 break;
1006 } 967 }
1007 } 968 }
1008 ++v130; 969 ++v130;
1009 break;
1010 } 970 }
1011 else if ( player_choose == 6 ) //random 971 else if ( player_choose == 6 ) //random
1012 { 972 {
1013 player_choose = rand() % 4; 973 player_choose = rand() % 4;
1014 pPlayer = &pParty->pPlayers[player_choose]; 974 pPlayer = &pParty->pPlayers[player_choose];
1015 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 975 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1016 ++curr_seq_num; 976 }
1017 v4 = v124; 977 ++curr_seq_num;
1018 break; 978 v4 = v124;
1019 } 979 break;
1020 case EVENT_Set: 980 case EVENT_Set:
1021 pValue = EVT_DWORD(_evt->v7); 981 pValue = EVT_DWORD(_evt->v7);
1022 if ( player_choose <= 3 ) 982 if ( player_choose <= 3 )
1023 { 983 {
1024 pPlayer = &pParty->pPlayers[player_choose]; 984 pPlayer = &pParty->pPlayers[player_choose];
1025 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 985 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1026 ++curr_seq_num;
1027 v4 = v124;
1028 break;
1029 } 986 }
1030 else if ( player_choose == 4 ) //active 987 else if ( player_choose == 4 ) //active
1031 { 988 {
1032 if ( uActiveCharacter ) 989 if ( uActiveCharacter )
1033 { 990 {
1034 pPlayer = pPlayers[uActiveCharacter]; 991 pPlayer = pPlayers[uActiveCharacter];
1035 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 992 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1036 ++curr_seq_num;
1037 v4 = v124;
1038 break;
1039 } 993 }
1040 } 994 }
1041 else if ( player_choose == 5 )//all 995 else if ( player_choose == 5 )//all
1042 { 996 {
997 //recheck v130
1043 for(int i = 1; i < 5; ++i) 998 for(int i = 1; i < 5; ++i)
1044 pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 999 pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1045 ++curr_seq_num; 1000
1046 v4 = v124;
1047 break;
1048 } 1001 }
1049 else if ( player_choose == 6 ) //random 1002 else if ( player_choose == 6 ) //random
1050 { 1003 {
1051 player_choose = rand() % 4; 1004 player_choose = rand() % 4;
1052 pPlayer = &pParty->pPlayers[player_choose]; 1005 pPlayer = &pParty->pPlayers[player_choose];
1053 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 1006 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1054 ++curr_seq_num; 1007
1055 v4 = v124; 1008 }
1056 break; 1009 ++curr_seq_num;
1057 } 1010 v4 = v124;
1011 break;
1058 case EVENT_Add: 1012 case EVENT_Add:
1059 pValue = EVT_DWORD(_evt->v7); 1013 pValue = EVT_DWORD(_evt->v7);
1060 if ( player_choose <= 3 ) 1014 if ( player_choose <= 3 )
1061 { 1015 {
1062 pPlayer = &pParty->pPlayers[player_choose]; 1016 pPlayer = &pParty->pPlayers[player_choose];
1063 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 1017 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1064 v83 = EVT_WORD(_evt->v5);
1065 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
1066 viewparams->bRedrawGameUI = 1;
1067 ++curr_seq_num;
1068 v4 = v124;
1069 break;
1070 } 1018 }
1071 else if ( player_choose == 4 ) //active 1019 else if ( player_choose == 4 ) //active
1072 { 1020 {
1073 if ( uActiveCharacter ) 1021 if ( uActiveCharacter )
1074 { 1022 {
1075 pPlayer = pPlayers[uActiveCharacter]; 1023 pPlayer = pPlayers[uActiveCharacter];
1076 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 1024 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1077 v83 = EVT_WORD(_evt->v5);
1078 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
1079 viewparams->bRedrawGameUI = 1;
1080 ++curr_seq_num;
1081 v4 = v124;
1082 break;
1083 } 1025 }
1084 } 1026 }
1085 else if ( player_choose == 5 )//all 1027 else if ( player_choose == 5 )//all
1086 { 1028 {
1087 //v130 = 0; 1029 //v130 = 0;
1088 for(int i = 1; i < 5; ++i) 1030 for(int i = 1; i < 5; ++i)
1089 pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 1031 pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1090 v83 = EVT_WORD(_evt->v5); 1032
1091 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
1092 viewparams->bRedrawGameUI = 1;
1093 ++curr_seq_num;
1094 v4 = v124;
1095 break;
1096 } 1033 }
1097 else if ( player_choose == 6 ) //random 1034 else if ( player_choose == 6 ) //random
1098 { 1035 {
1099 player_choose = rand() % 4; 1036 player_choose = rand() % 4;
1100 pPlayer = &pParty->pPlayers[player_choose]; 1037 pPlayer = &pParty->pPlayers[player_choose];
1101 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 1038 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1102 v83 = EVT_WORD(_evt->v5); 1039 }
1103 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) 1040 v83 = EVT_WORD(_evt->v5);
1104 viewparams->bRedrawGameUI = 1; 1041 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
1105 ++curr_seq_num; 1042 viewparams->bRedrawGameUI = 1;
1106 v4 = v124; 1043 ++curr_seq_num;
1107 break; 1044 v4 = v124;
1108 } 1045 break;
1109 case EVENT_InputString: 1046 case EVENT_InputString:
1110 if ( !start_event_seq_number ) 1047 if ( !start_event_seq_number )
1111 { 1048 {
1112 strcpy(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]); 1049 strcpy(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
1113 v105 = curr_seq_num; 1050 v105 = curr_seq_num;
1114 v121 = 26; 1051 v121 = 26;
1115 LABEL_295: 1052 LABEL_295:
1116 sub_4451A8_press_any_key(uEventID, v105, v121); 1053 sub_4451A8_press_any_key(uEventID, v105, v121);
1117 LABEL_301: 1054 LABEL_301:
1138 break; 1075 break;
1139 case EVENT_RandomGoTo: 1076 case EVENT_RandomGoTo:
1140 //v124 = -1; 1077 //v124 = -1;
1141 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0) 1078 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
1142 + (_evt->v10 != 0))); 1079 + (_evt->v10 != 0)));
1143 goto LABEL_131; 1080 curr_seq_num = v11 - 1;
1081 ++curr_seq_num;
1082 v4 = v124;
1144 case EVENT_ReceiveDamage: 1083 case EVENT_ReceiveDamage:
1145 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1084 v85 = EVT_DWORD(_evt->v7 );
1146 v86 = _evt->v5; 1085 v86 = _evt->v5;
1147 if ( (unsigned __int8)v86 <= 3u ) 1086 if ( (unsigned __int8)v86 <= 3u )
1148 { 1087 {
1149 v119 = _evt->v6; 1088 v119 = _evt->v6;
1150 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1089 v115 = EVT_DWORD(_evt->v7 );
1151 v89 = (unsigned __int8)v86; 1090 v89 = (unsigned __int8)v86;
1152 goto LABEL_233; 1091 goto LABEL_233;
1153 } 1092 }
1154 if ( v86 == 4 ) 1093 if ( v86 == 4 )
1155 { 1094 {
1162 //v7 = ""; 1101 //v7 = "";
1163 break; 1102 break;
1164 } 1103 }
1165 v119 = _evt->v6; 1104 v119 = _evt->v6;
1166 v88 = pPlayers[uActiveCharacter]; 1105 v88 = pPlayers[uActiveCharacter];
1167 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1106 v115 = EVT_DWORD(_evt->v7 );
1168 goto LABEL_234; 1107 goto LABEL_234;
1169 } 1108 }
1170 if ( v86 != 5 ) 1109 if ( v86 != 5 )
1171 { 1110 {
1172 v119 = _evt->v6; 1111 v119 = _evt->v6;
1173 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10<< 8)) << 8)) << 8); 1112 v115 = EVT_DWORD(_evt->v7 );
1174 v89 = rand() % 4; 1113 v89 = rand() % 4;
1175 LABEL_233: 1114 LABEL_233:
1176 v88 = &pParty->pPlayers[v89]; 1115 v88 = &pParty->pPlayers[v89];
1177 LABEL_234: 1116 LABEL_234:
1178 v88->ReceiveDamage(v115, v119); 1117 v88->ReceiveDamage(v115, v119);
1195 1134
1196 //v6 = v123; 1135 //v6 = v123;
1197 //v7 = ""; 1136 //v7 = "";
1198 break; 1137 break;
1199 case EVENT_ToggleIndoorLight: 1138 case EVENT_ToggleIndoorLight:
1200 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); 1139 pIndoor->ToggleLight(EVT_DWORD(_evt->v5 ), _evt->v9);
1201 ++curr_seq_num; 1140 ++curr_seq_num;
1202 v4 = v124; 1141 v4 = v124;
1203 1142
1204 //v6 = v123; 1143 //v6 = v123;
1205 //v7 = ""; 1144 //v7 = "";
1206 break; 1145 break;
1207 case EVENT_SetFacesBit: 1146 case EVENT_SetFacesBit:
1208 sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 1147 sub_44892E_set_faces_bit(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
1209 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
1210 ++curr_seq_num; 1148 ++curr_seq_num;
1211 v4 = v124; 1149 v4 = v124;
1212 1150
1213 //v6 = v123; 1151 //v6 = v123;
1214 //v7 = ""; 1152 //v7 = "";
1215 break; 1153 break;
1216 case EVENT_ToggleChestFlag: 1154 case EVENT_ToggleChestFlag:
1217 Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 1155 Chest::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
1218 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
1219 ++curr_seq_num; 1156 ++curr_seq_num;
1220 v4 = v124; 1157 v4 = v124;
1221 1158
1222 //v6 = v123; 1159 //v6 = v123;
1223 //v7 = ""; 1160 //v7 = "";
1224 break; 1161 break;
1225 case EVENT_ToggleActorFlag: 1162 case EVENT_ToggleActorFlag:
1226 Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), 1163 Actor::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
1227 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
1228 ++curr_seq_num; 1164 ++curr_seq_num;
1229 v4 = v124; 1165 v4 = v124;
1230 1166
1231 //v6 = v123; 1167 //v6 = v123;
1232 //v7 = ""; 1168 //v7 = "";
1233 break; 1169 break;
1234 case EVENT_ToggleActorGroupFlag: 1170 case EVENT_ToggleActorGroupFlag:
1235 ToggleActorGroupFlag( 1171 ToggleActorGroupFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
1236 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
1237 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
1238 _evt->v13);
1239 ++curr_seq_num; 1172 ++curr_seq_num;
1240 v4 = v124; 1173 v4 = v124;
1241 1174
1242 //v6 = v123; 1175 //v6 = v123;
1243 //v7 = ""; 1176 //v7 = "";
1250 1183
1251 //v6 = v123; 1184 //v6 = v123;
1252 //v7 = ""; 1185 //v7 = "";
1253 break; 1186 break;
1254 case EVENT_StatusText: 1187 case EVENT_StatusText:
1255 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); 1188 v90 = EVT_DWORD(_evt->v5 );
1256 if ( activeLevelDecoration ) 1189 if ( activeLevelDecoration )
1257 { 1190 {
1258 if ( activeLevelDecoration == (void*)1 ) 1191 if ( activeLevelDecoration == (LevelDecoration*)1 )
1259 { 1192 {
1260 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; 1193 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
1261 ++curr_seq_num;
1262 v4 = v124;
1263
1264 //v6 = v123;
1265 //v7 = "";
1266 break;
1267 } 1194 }
1268 if ( canShowMessages == 1 ) 1195 if ( canShowMessages == 1 )
1269 { 1196 {
1270 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; 1197 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
1271 //LABEL_248: 1198 //LABEL_248:
1272 ShowStatusBarString(v91, 2u); 1199 ShowStatusBarString(v91, 2u);
1273 ++curr_seq_num;
1274 v4 = v124;
1275
1276 //v6 = v123;
1277 //v7 = "";
1278 break;
1279 } 1200 }
1280 } 1201 }
1281 else 1202 else
1282 { 1203 {
1283 if ( canShowMessages == 1 ) 1204 if ( canShowMessages == 1 )
1284 { 1205 {
1285 v91 = &pLevelStr[pLevelStrOffsets[v90]]; 1206 v91 = &pLevelStr[pLevelStrOffsets[v90]];
1286 ShowStatusBarString(v91, 2u); 1207 ShowStatusBarString(v91, 2u);
1287 ++curr_seq_num;
1288 v4 = v124;
1289
1290 //v6 = v123;
1291 //v7 = "";
1292 break;
1293 } 1208 }
1294 } 1209 }
1295 ++curr_seq_num; 1210 ++curr_seq_num;
1296 v4 = v124; 1211 v4 = v124;
1297 1212
1298 //v6 = v123; 1213 //v6 = v123;
1299 //v7 = ""; 1214 //v7 = "";
1300 break; 1215 break;
1301 case EVENT_ShowMessage: 1216 case EVENT_ShowMessage:
1302 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); 1217 v92 = EVT_DWORD(_evt->v5 );
1303 if ( activeLevelDecoration ) 1218 if ( activeLevelDecoration )
1304 { 1219 {
1305 v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92]; 1220 v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92];
1306 byte_5B0938[0] = 0; 1221 byte_5B0938[0] = 0;
1307 ptr_F8B1E8 = v93; 1222 ptr_F8B1E8 = v93;
1315 1230
1316 //v6 = v123; 1231 //v6 = v123;
1317 //v7 = ""; 1232 //v7 = "";
1318 break; 1233 break;
1319 case EVENT_CastSpell: 1234 case EVENT_CastSpell:
1320 sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), 1235 sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, EVT_DWORD(_evt->v8 ),
1321 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), 1236 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
1322 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), 1237 EVT_DWORD(_evt->v24 ), EVT_DWORD(_evt->v28 ));
1323 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), 1238 ++curr_seq_num;
1324 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8), 1239 v4 = v124;
1325 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8)); 1240
1326 ++curr_seq_num;
1327 v4 = v124;
1328
1329 //v6 = v123;
1330 //v7 = "";
1331 break; 1241 break;
1332 case EVENT_SetTexture: 1242 case EVENT_SetTexture:
1333 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); 1243 sub_44861E_set_texture(EVT_DWORD(_evt->v5 ), (char *)&_evt->v9);
1334 ++curr_seq_num; 1244 ++curr_seq_num;
1335 v4 = v124; 1245 v4 = v124;
1336 1246
1337 //v6 = v123; 1247 //v6 = v123;
1338 //v7 = ""; 1248 //v7 = "";
1339 break; 1249 break;
1340 case EVENT_SetSprite: 1250 case EVENT_SetSprite:
1341 SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); 1251 SetDecorationSprite(EVT_DWORD(_evt->v5 ), _evt->v9, (char *)&_evt->v10);
1342 ++curr_seq_num; 1252 ++curr_seq_num;
1343 v4 = v124; 1253 v4 = v124;
1344 1254
1345 //v6 = v123; 1255 //v6 = v123;
1346 //v7 = ""; 1256 //v7 = "";
1347 break; 1257 break;
1348 case EVENT_SummonMonsters: 1258 case EVENT_SummonMonsters:
1349 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7, 1259 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,EVT_DWORD(_evt->v8 ),
1350 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), 1260 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
1351 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), 1261 EVT_DWORD(_evt->v24 ));
1352 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
1353 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
1354 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
1355 ++curr_seq_num; 1262 ++curr_seq_num;
1356 v4 = v124; 1263 v4 = v124;
1357 1264
1358 //v6 = v123; 1265 //v6 = v123;
1359 //v7 = ""; 1266 //v7 = "";
1518 pRenderer->_49FD3A(); 1425 pRenderer->_49FD3A();
1519 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); 1426 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
1520 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0); 1427 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
1521 v104 = 187; 1428 v104 = 187;
1522 if ( uCurrentHouse_Animation != 167 ) 1429 if ( uCurrentHouse_Animation != 167 )
1523 v104 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); 1430 v104 = EVT_DWORD(_evt->v5);
1524 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); 1431 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
1525 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, 0x6Eu, 1, 49, "", 0); 1432 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, 0x6Eu, 1, 49, "", 0);
1526 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, 0x6Eu, 2, 50, "", 0); 1433 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, 0x6Eu, 2, 50, "", 0);
1527 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, 0x6Eu, 3, 51, "", 0); 1434 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, 0x6Eu, 3, 51, "", 0);
1528 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, 0x6Eu, 4, 52, "", 0); 1435 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, 0x6Eu, 4, 52, "", 0);
1529 window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); 1436 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
1530 } 1437 }
1531 ++curr_seq_num; 1438 ++curr_seq_num;
1532 v4 = v124; 1439 v4 = v124;
1533 1440
1534 //v6 = v123; 1441 //v6 = v123;