Mercurial > mm7
comparison UI/UIHouses.cpp @ 1526:f47eab1a70d8
UIHouses.cpp cleaning(continue)
author | Ritor1 |
---|---|
date | Thu, 05 Sep 2013 18:05:50 +0600 |
parents | ab6bf38b2940 |
children | 61458df2cb4f |
comparison
equal
deleted
inserted
replaced
1525:863de6ec906b | 1526:f47eab1a70d8 |
---|---|
106 { 31, 32, 33, 33}, // HOUSE_BOATS_70 | 106 { 31, 32, 33, 33}, // HOUSE_BOATS_70 |
107 { 24, 24, 24, 24}, // HOUSE_BOATS_71 | 107 { 24, 24, 24, 24}, // HOUSE_BOATS_71 |
108 {255, 255, 255, 255}, // HOUSE_BOATS_72 | 108 {255, 255, 255, 255}, // HOUSE_BOATS_72 |
109 {255, 255, 255, 255} // HOUSE_BOATS_73 | 109 {255, 255, 255, 255} // HOUSE_BOATS_73 |
110 }; | 110 }; |
111 | |
112 | |
113 | |
114 | |
115 | 111 |
116 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70 | 112 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70 |
117 {{ | 113 {{ |
118 {"", 0x4, 0x1F4, 0, 0, 0}, | 114 {"", 0x4, 0x1F4, 0, 0, 0}, |
119 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0}, | 115 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0}, |
324 if (type == BuildingType_Tavern) | 320 if (type == BuildingType_Tavern) |
325 { | 321 { |
326 num_buttons = 2; | 322 num_buttons = 2; |
327 CreateButtonInColumn(0, 102); | 323 CreateButtonInColumn(0, 102); |
328 CreateButtonInColumn(1, 103); | 324 CreateButtonInColumn(1, 103); |
329 if ( pParty->HasItem(651) ) //Arcomage Deck | 325 if ( pParty->HasItem(651) ) //Arcomage Deck |
330 { | 326 { |
331 num_buttons = 3; | 327 num_buttons = 3; |
332 CreateButtonInColumn(2, 104); | 328 CreateButtonInColumn(2, 104); |
333 } | 329 } |
334 } | 330 } |
367 // F8B1E0: using guessed type int dword_F8B1E0; | 363 // F8B1E0: using guessed type int dword_F8B1E0; |
368 | 364 |
369 //----- (004B3B42) -------------------------------------------------------- | 365 //----- (004B3B42) -------------------------------------------------------- |
370 void InitializaDialogueOptions(BuildingType type) | 366 void InitializaDialogueOptions(BuildingType type) |
371 { | 367 { |
372 /*int v1; // ecx@18 | |
373 int v2; // ecx@19 | |
374 int v3; // ecx@20 | |
375 signed int v4; // esi@22 | |
376 signed int v5; // eax@22 | |
377 unsigned int v6; // edx@24 | |
378 int v7; // ecx@24 | |
379 int result; // eax@43 | |
380 int v9; // [sp-10h] [bp-14h]@28 | |
381 int v10; // [sp-Ch] [bp-10h]@28 | |
382 int v11; // [sp-8h] [bp-Ch]@28 | |
383 unsigned int v12; // [sp-4h] [bp-8h]@4 | |
384 unsigned int v13; // [sp-4h] [bp-8h]@5 | |
385 unsigned int v14; // [sp-4h] [bp-8h]@9 | |
386 unsigned int v15; // [sp-4h] [bp-8h]@10 | |
387 unsigned int v16; // [sp-4h] [bp-8h]@14 | |
388 int v17; // [sp-4h] [bp-8h]@28*/ | |
389 | |
390 switch (type) | 368 switch (type) |
391 { | 369 { |
392 case BuildingType_WeaponShop: | 370 case BuildingType_WeaponShop: |
393 case BuildingType_ArmorShop: | 371 case BuildingType_ArmorShop: |
394 case BuildingType_MagicShop: | 372 case BuildingType_MagicShop: |
762 | 740 |
763 | 741 |
764 //----- (004B1784) -------------------------------------------------------- | 742 //----- (004B1784) -------------------------------------------------------- |
765 bool HouseUI_CheckIfPlayerCanInteract() | 743 bool HouseUI_CheckIfPlayerCanInteract() |
766 { | 744 { |
767 Player *pPlayer; // ebx@1 | 745 GUIWindow window; // [sp+4h] [bp-54h]@3 |
768 bool result; // eax@2 | 746 |
769 int v3; // eax@3 | 747 if ( pPlayers[uActiveCharacter]->CanAct() ) |
770 GUIWindow v4; // [sp+4h] [bp-54h]@3 | |
771 | |
772 pPlayer = pPlayers[uActiveCharacter]; | |
773 if ( pPlayer->CanAct() ) | |
774 { | 748 { |
775 pDialogueWindow->pNumPresenceButton = dword_F8B1E0; | 749 pDialogueWindow->pNumPresenceButton = dword_F8B1E0; |
776 result = 1; | 750 return true; |
777 } | 751 } |
778 else | 752 else |
779 { | 753 { |
780 pDialogueWindow->pNumPresenceButton = 0; | 754 pDialogueWindow->pNumPresenceButton = 0; |
781 memcpy(&v4, pPrimaryWindow, sizeof(v4)); | 755 memcpy(&window, pPrimaryWindow, sizeof(window)); |
782 v4.uFrameX = 483; | 756 window.uFrameX = 483; |
783 v4.uFrameWidth = 148; | 757 window.uFrameWidth = 148; |
784 v4.uFrameZ = 334; | 758 window.uFrameZ = 334; |
785 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);// | 759 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, |
786 // "%s is in no condition to %s" | 760 pGlobalTXT_LocalizationStrings[562]); // "%s is in no condition to %s""do anything" |
787 // "do anything" | 761 window.DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &window, 0, 0)) / 2 + 101, ui_house_player_cant_interact_color, pTmpBuf.data(), 3); |
788 v3 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v4, 0, 0); | 762 return false; |
789 v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, ui_house_player_cant_interact_color, pTmpBuf.data(), 3u); | |
790 result = 0; | |
791 } | 763 } |
792 return result; | |
793 } | 764 } |
794 | 765 |
795 //----- (0044622E) -------------------------------------------------------- | 766 //----- (0044622E) -------------------------------------------------------- |
796 bool EnterHouse(enum HOUSE_ID uHouseID) | 767 bool EnterHouse(enum HOUSE_ID uHouseID) |
797 { | 768 { |
798 //enum HOUSE_ID v1; // edi@1 | |
799 //int v2; // edi@5 | |
800 signed int uOpenTime; // eax@5 | 769 signed int uOpenTime; // eax@5 |
801 signed int uCloseTime; // esi@5 | 770 signed int uCloseTime; // esi@5 |
802 unsigned int v5; // esi@5 | 771 unsigned int v5; // esi@5 |
803 int v6; // edx@5 | 772 int v6; // edx@5 |
804 signed int am_pm_flag_open; // ecx@10 | 773 signed int am_pm_flag_open; // ecx@10 |
805 signed int am_pm_flag_close; // eax@10 | 774 signed int am_pm_flag_close; // eax@10 |
806 int v9; // esi@10 | 775 int v9; // esi@10 |
807 //unsigned int v10; // esi@16 | |
808 int v11; // ecx@17 | 776 int v11; // ecx@17 |
809 unsigned int v12; // kr00_4@25 | 777 unsigned int v12; // kr00_4@25 |
810 //Player *v13; // esi@25 | |
811 int v14; // eax@25 | 778 int v14; // eax@25 |
812 //Player *v15; // esi@27 | |
813 //signed int v16; // eax@32 | |
814 unsigned int v17; // eax@37 | 779 unsigned int v17; // eax@37 |
815 signed int v18; // edi@37 | 780 signed int v18; // edi@37 |
816 signed int v19; // edi@41 | 781 signed int v19; // edi@41 |
817 //unsigned int v20; // ecx@41 | |
818 //const char *v22; // [sp-4h] [bp-40h]@33 | |
819 char pContainer[40]; // [sp+Ch] [bp-30h]@32 | 782 char pContainer[40]; // [sp+Ch] [bp-30h]@32 |
820 unsigned int v24; // [sp+34h] [bp-8h]@5 | 783 unsigned int v24; // [sp+34h] [bp-8h]@5 |
821 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1 | 784 |
822 | |
823 //v1 = uHouseID; | |
824 //v25 = uHouseID; | |
825 GameUI_Footer_TimedString[0] = 0; | 785 GameUI_Footer_TimedString[0] = 0; |
826 pFooterString[0] = 0; | 786 pFooterString[0] = 0; |
827 ShowStatusBarString("", 2u); | 787 ShowStatusBarString("", 2); |
828 if ( pMessageQueue_50CBD0->uNumMessages ) | 788 if ( pMessageQueue_50CBD0->uNumMessages ) |
829 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 789 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
830 viewparams->bRedrawGameUI = 1; | 790 viewparams->bRedrawGameUI = 1; |
831 uDialogueType = 0; | 791 uDialogueType = 0; |
832 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); | 792 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
950 } | 910 } |
951 | 911 |
952 //----- (0044606A) -------------------------------------------------------- | 912 //----- (0044606A) -------------------------------------------------------- |
953 void PrepareHouse(HOUSE_ID house) | 913 void PrepareHouse(HOUSE_ID house) |
954 { | 914 { |
955 //unsigned int v1; // ebx@1 | |
956 //signed int v2; // esi@1 | |
957 //int uExitPic; // edi@1 | |
958 __int16 uExitMapID; // ax@2 | 915 __int16 uExitMapID; // ax@2 |
959 //int result; // eax@5 | |
960 //unsigned int *v6; // ecx@8 | |
961 int v7; // ebx@11 | 916 int v7; // ebx@11 |
962 //int v8; // esi@16 | |
963 //unsigned int v9; // eax@16 | |
964 //unsigned int v10; // eax@19 | |
965 //int v11; // ecx@19 | |
966 //char pContainer[36]; // [sp+Ch] [bp-54h]@16 | |
967 int v13; // [sp+30h] [bp-30h]@11 | 917 int v13; // [sp+30h] [bp-30h]@11 |
968 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1 | 918 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1 |
969 //unsigned int v15; // [sp+4Ch] [bp-14h]@1 | |
970 int uAnimationID; // [sp+50h] [bp-10h]@1 | 919 int uAnimationID; // [sp+50h] [bp-10h]@1 |
971 //unsigned int *v17; // [sp+54h] [bp-Ch]@3 | |
972 //unsigned int v18; // [sp+58h] [bp-8h]@1 | |
973 //int v19; // [sp+5Ch] [bp-4h]@7 | |
974 | 920 |
975 | 921 |
976 uAnimationID = p2DEvents[house - 1].uAnimationID; | 922 uAnimationID = p2DEvents[house - 1].uAnimationID; |
977 memset(npc_id_arr, 0, sizeof(npc_id_arr)); | 923 memset(npc_id_arr, 0, sizeof(npc_id_arr)); |
978 uNumDialogueNPCPortraits = 0; | 924 uNumDialogueNPCPortraits = 0; |
1039 } | 985 } |
1040 | 986 |
1041 //----- (004BCACC) -------------------------------------------------------- | 987 //----- (004BCACC) -------------------------------------------------------- |
1042 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam) | 988 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam) |
1043 { | 989 { |
1044 //unsigned int v1; // edi@1 | 990 int experience_for_next_level; // eax@5 |
1045 //signed int v2; // ebx@1 | |
1046 //signed int v3; // ecx@2 | |
1047 int v4; // eax@5 | |
1048 signed int v5; // esi@5 | |
1049 //Player *v6; // ecx@5 | |
1050 //signed int v7; // edx@5 | |
1051 GUIWindow *v8; // esi@10 | 991 GUIWindow *v8; // esi@10 |
1052 unsigned int v9; // eax@12 | |
1053 int v10; // esi@31 | 992 int v10; // esi@31 |
1054 int v11; // edi@31 | 993 int v11; // edi@31 |
1055 int v12; // esi@32 | 994 int v12; // esi@32 |
1056 __int16 v13; // bp@32 | 995 __int16 v13; // bp@32 |
1057 int v14; // edx@32 | 996 int v14; // edx@32 |
1068 int v25; // esi@190 | 1007 int v25; // esi@190 |
1069 __int16 v26; // ax@190 | 1008 __int16 v26; // ax@190 |
1070 char v27; // zf@190 | 1009 char v27; // zf@190 |
1071 Player *v28; // edi@192 | 1010 Player *v28; // edi@192 |
1072 int v29; // eax@204 | 1011 int v29; // eax@204 |
1073 void *v30; // esi@208 | 1012 //void *v30; // esi@208 |
1074 unsigned __int64 v31; // qax@208 | 1013 //unsigned __int64 v31; // qax@208 |
1075 signed int v32; // edi@209 | 1014 //signed int v32; // edi@209 |
1076 int v33; // eax@210 | 1015 //int v33; // eax@210 |
1077 unsigned int v34; // eax@211 | 1016 unsigned int v34; // eax@211 |
1078 //Player *v35; // edi@227 | |
1079 signed int v36; // esi@227 | 1017 signed int v36; // esi@227 |
1080 int v37; // ecx@227 | 1018 int v37; // ecx@227 |
1081 int v38; // esi@230 | 1019 int v38; // esi@230 |
1082 int v39; // edx@235 | 1020 int v39; // edx@235 |
1083 int v40; // edi@243 | 1021 int v40; // edi@243 |
1084 unsigned __int64 v41; // qax@243 | 1022 unsigned __int64 v41; // qax@243 |
1085 //void *v42; // eax@244 | |
1086 signed int v43; // edi@244 | 1023 signed int v43; // edi@244 |
1087 int v44; // edx@244 | 1024 int v44; // edx@244 |
1088 int v45; // eax@246 | 1025 int v45; // eax@246 |
1089 unsigned int v46; // eax@247 | 1026 unsigned int v46; // eax@247 |
1090 void *v47; // eax@250 | 1027 void *v47; // eax@250 |
1093 int v50; // eax@256 | 1030 int v50; // eax@256 |
1094 unsigned int v51; // eax@257 | 1031 unsigned int v51; // eax@257 |
1095 void *v52; // eax@260 | 1032 void *v52; // eax@260 |
1096 signed int v53; // edi@260 | 1033 signed int v53; // edi@260 |
1097 int v54; // eax@262 | 1034 int v54; // eax@262 |
1098 //signed int v55; // [sp+10h] [bp-10h]@1 | |
1099 int v56; // [sp+14h] [bp-Ch]@31 | 1035 int v56; // [sp+14h] [bp-Ch]@31 |
1100 | 1036 |
1101 //v1 = 0; | |
1102 //v2 = a1; | |
1103 //v55 = a1; | |
1104 if ( !pDialogueWindow->pNumPresenceButton ) | 1037 if ( !pDialogueWindow->pNumPresenceButton ) |
1105 return; | 1038 return; |
1106 pRenderer->ClearZBuffer(0, 479); | 1039 pRenderer->ClearZBuffer(0, 479); |
1107 //v3 = dword_F8B198; | |
1108 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN) | 1040 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN) |
1109 v8 = window_SpeakInHouse; | 1041 v8 = window_SpeakInHouse; |
1110 //else | |
1111 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN) | 1042 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
1112 { | 1043 { |
1113 if ( in_current_building_type == BuildingType_Training ) | 1044 if ( in_current_building_type == BuildingType_Training ) |
1114 { | 1045 { |
1115 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN ) | 1046 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN ) |
1116 { | 1047 { |
1117 v4 = 0; | 1048 experience_for_next_level = 0; |
1118 v5 = 0; | |
1119 //v6 = pPlayers[uActiveCharacter]; | |
1120 //v7 = pPlayers[uActiveCharacter]->uLevel; | |
1121 if ( pPlayers[uActiveCharacter]->uLevel > 0 ) | 1049 if ( pPlayers[uActiveCharacter]->uLevel > 0 ) |
1122 { | 1050 { |
1123 do | 1051 for( uint i = 0; i < pPlayers[uActiveCharacter]->uLevel; i++ ) |
1124 v4 += v5++ + 1; | 1052 experience_for_next_level += i + 1; |
1125 while ( v5 < pPlayers[uActiveCharacter]->uLevel ); | |
1126 } | 1053 } |
1127 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] && | 1054 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] && |
1128 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4) | 1055 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * experience_for_next_level) |
1129 return; | 1056 return; |
1130 } | 1057 } |
1131 pDialogueWindow->Release(); | 1058 pDialogueWindow->Release(); |
1132 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); | 1059 pDialogueWindow = GUIWindow::Create(0, 0, 640, 345, WINDOW_MainMenu, 0, 0); |
1133 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" | 1060 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" |
1134 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); | 1061 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
1135 pDialogueWindow->CreateButton(8, 8, 0x1C2, 0x140, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); | 1062 pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); |
1136 // LABEL_10: | |
1137 //v3 = dword_F8B198; | |
1138 v8 = window_SpeakInHouse; | 1063 v8 = window_SpeakInHouse; |
1139 } | 1064 } |
1140 //else | |
1141 if ( in_current_building_type != BuildingType_Training ) | 1065 if ( in_current_building_type != BuildingType_Training ) |
1142 { | 1066 { |
1143 v8 = window_SpeakInHouse; | 1067 v8 = window_SpeakInHouse; |
1144 if ((in_current_building_type == BuildingType_Stables || in_current_building_type == BuildingType_Boats) && | 1068 if ((in_current_building_type == BuildingType_Stables || in_current_building_type == BuildingType_Boats) && |
1145 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7] | 1069 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7] |
1146 || in_current_building_type != BuildingType_Temple || uMessageParam != BuildingType_MindGuild ) | 1070 || in_current_building_type != BuildingType_Temple || uMessageParam != BuildingType_MindGuild ) |
1147 { | 1071 { |
1148 //LABEL_9: | |
1149 pDialogueWindow->Release(); | 1072 pDialogueWindow->Release(); |
1150 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); | 1073 pDialogueWindow = GUIWindow::Create(0, 0, 640, 345, WINDOW_MainMenu, 0, 0); |
1151 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" | 1074 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" |
1152 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); | 1075 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
1153 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); | 1076 pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); |
1154 // LABEL_10: | |
1155 //v3 = dword_F8B198; | |
1156 v8 = window_SpeakInHouse; | 1077 v8 = window_SpeakInHouse; |
1157 } | 1078 } |
1158 else if (uActiveCharacter) | 1079 else if (uActiveCharacter) |
1159 { | 1080 { |
1160 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() ) | 1081 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() ) |
1161 return; | 1082 return; |
1162 v8 = window_SpeakInHouse; | 1083 v8 = window_SpeakInHouse; |
1163 } | 1084 } |
1164 } | 1085 } |
1165 //LABEL_11: | |
1166 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam; | 1086 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam; |
1167 if ( in_current_building_type < BuildingType_19 ) | 1087 if ( in_current_building_type < BuildingType_19 ) |
1168 { | 1088 { |
1169 v9 = pIcons_LOD->LoadTexture(off_4F03B8[(int)in_current_building_type], TEXTURE_16BIT_PALETTE); | 1089 ShopTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(off_4F03B8[(int)in_current_building_type], TEXTURE_16BIT_PALETTE)]; |
1170 //v3 = dword_F8B198; | |
1171 ShopTexture = &pIcons_LOD->pTextures[v9]; | |
1172 //LABEL_13: | |
1173 v8 = window_SpeakInHouse; | 1090 v8 = window_SpeakInHouse; |
1174 } | 1091 } |
1175 } | 1092 } |
1176 | 1093 |
1177 //NEW | 1094 //NEW |
1188 case BuildingType_DarkGuild: | 1105 case BuildingType_DarkGuild: |
1189 case BuildingType_14: | 1106 case BuildingType_14: |
1190 case BuildingType_15: | 1107 case BuildingType_15: |
1191 case BuildingType_16: | 1108 case BuildingType_16: |
1192 { | 1109 { |
1193 if ( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472] >= (signed __int64)pParty->uTimePlayed && | 1110 if ( pParty->field_3C.field_50[window_SpeakInHouse->par1C] >= (signed __int64)pParty->uTimePlayed ) |
1194 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468] >= (signed __int64)pParty->uTimePlayed ) | 1111 { |
1195 { | 1112 for ( uint i = 0; i < 12; ++i ) |
1196 v32 = 0; | 1113 { |
1197 do | 1114 if ( pParty->SpellBooksInGuilds[v8->par1C-139][i].uItemID ) |
1198 { | |
1199 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C)); | |
1200 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID; | |
1201 if ( v33 ) | |
1202 { | 1115 { |
1203 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE); | 1116 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->SpellBooksInGuilds[v8->par1C-139][i].uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1204 v8 = window_SpeakInHouse; | 1117 v8 = window_SpeakInHouse; |
1205 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34]; | 1118 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[v34]; |
1206 } | 1119 } |
1207 ++v32; | 1120 } |
1208 } | |
1209 while ( v32 < 12 ); | |
1210 } | 1121 } |
1211 else | 1122 else |
1212 { | 1123 { |
1213 SpellBookGenerator(); | 1124 SpellBookGenerator(); |
1214 v30 = window_SpeakInHouse->ptr_1C; | 1125 pParty->field_3C.field_50[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 |
1215 v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 | |
1216 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) | |
1217 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); | 1126 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); |
1218 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31; | |
1219 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31); | |
1220 } | 1127 } |
1221 //return; | 1128 //return; |
1222 break; | 1129 break; |
1223 } | 1130 } |
1224 case BuildingType_TownHall: | 1131 case BuildingType_TownHall: |