comparison mm7_2.cpp @ 672:0b908cda781f

OnSelectShopDialogueOption clean 1
author zipi
date Thu, 14 Mar 2013 22:11:35 +0000
parents 2bb0e9da8302
children 638bd256ca46
comparison
equal deleted inserted replaced
671:2bb0e9da8302 672:0b908cda781f
892 //v3 = dword_F8B198; 892 //v3 = dword_F8B198;
893 if ( dialog_menu_id != 1 ) 893 if ( dialog_menu_id != 1 )
894 { 894 {
895 v8 = window_SpeakInHouse; 895 v8 = window_SpeakInHouse;
896 } 896 }
897 else 897 //else
898 if ( dialog_menu_id == 1 )
898 { 899 {
899 if ( in_current_building_type == BildingType_Training ) 900 if ( in_current_building_type == BildingType_Training )
900 { 901 {
901 if ( uMessageParam == 17 ) 902 if ( uMessageParam == 17 )
902 { 903 {
921 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr); 922 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr);
922 // LABEL_10: 923 // LABEL_10:
923 //v3 = dword_F8B198; 924 //v3 = dword_F8B198;
924 v8 = window_SpeakInHouse; 925 v8 = window_SpeakInHouse;
925 } 926 }
926 else 927 //else
928 if ( in_current_building_type != BildingType_Training )
927 { 929 {
928 v8 = window_SpeakInHouse; 930 v8 = window_SpeakInHouse;
929 if ( (in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) 931 if ( (in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats)
930 && (*(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + uMessageParam)] + pParty->uDaysPlayed % 7)) 932 && (*(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + uMessageParam)] + pParty->uDaysPlayed % 7))
931 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild ) 933 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
956 ShopTexture = &pIcons_LOD->pTextures[v9]; 958 ShopTexture = &pIcons_LOD->pTextures[v9];
957 //LABEL_13: 959 //LABEL_13:
958 v8 = window_SpeakInHouse; 960 v8 = window_SpeakInHouse;
959 } 961 }
960 } 962 }
963
964 //NEW
965 switch(in_current_building_type)
966 {
967 case 5:
968 case 6:
969 case 7:
970 case 8:
971 case 9:
972 case 10:
973 case 11:
974 case 12:
975 case 13:
976 case 14:
977 case 15:
978 case 16:
979 {
980 if ( (signed __int64)__PAIR__(
981 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
982 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
983 {
984 v32 = 0;
985 do
986 {
987 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
988 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
989 if ( v33 )
990 {
991 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
992 v8 = window_SpeakInHouse;
993 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
994 }
995 ++v32;
996 }
997 while ( v32 < 12 );
998 }
999 else
1000 {
1001 SpellBookGenerator();
1002 v30 = window_SpeakInHouse->ptr_1C;
1003 v31 = pParty->uTimePlayed
1004 + (signed __int64)((double)(0xA8C000
1005 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
1006 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
1007 * 0.033333335);
1008 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
1009 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
1010 }
1011 return;
1012 break;
1013 }
1014 case 17:
1015 {
1016 if ( uMessageParam == 99 )
1017 {
1018 v10 = (int)((char *)v8->ptr_1C - 102);
1019 v56 = v10;
1020 v11 = 8 * v10 + 11325428;
1021 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
1022 {
1023 v13 = 0;
1024 }
1025 else
1026 {
1027 v12 = v10;
1028 v13 = 0;
1029 pParty->field_75A[v12] = 0;
1030 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
1031 v14 = rand() % 258;
1032 v15 = window_SpeakInHouse;
1033 pParty->field_750[v12] = v14 + 1;
1034 v16 = (int)((char *)v15->ptr_1C - 102);
1035 if ( v16 )
1036 {
1037 v17 = v16 - 1;
1038 if ( v17 )
1039 {
1040 v18 = v17 - 1;
1041 if ( v18 )
1042 {
1043 v19 = v18 - 1;
1044 if ( v19 )
1045 {
1046 if ( v19 == 1 )
1047 {
1048 while ( 1 )
1049 {
1050 v20 = pParty->field_750[v12];
1051 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
1052 {
1053 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
1054 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
1055 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
1056 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
1057 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
1058 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
1059 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
1060 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
1061 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
1062 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
1063 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
1064 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
1065 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
1066 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
1067 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
1068 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
1069 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
1070 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
1071 break;
1072 }
1073 pParty->field_750[v12] = rand() % 258 + 1;
1074 }
1075 }
1076 }
1077 else
1078 {
1079 while ( 1 )
1080 {
1081 v21 = pParty->field_750[v12];
1082 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
1083 {
1084 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
1085 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
1086 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
1087 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
1088 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
1089 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
1090 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
1091 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
1092 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
1093 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
1094 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
1095 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
1096 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
1097 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
1098 break;
1099 }
1100 pParty->field_750[v12] = rand() % 258 + 1;
1101 }
1102 }
1103 }
1104 else
1105 {
1106 while ( 1 )
1107 {
1108 v22 = pParty->field_750[v12];
1109 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
1110 {
1111 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
1112 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
1113 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
1114 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
1115 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
1116 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
1117 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
1118 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
1119 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
1120 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
1121 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
1122 break;
1123 }
1124 pParty->field_750[v12] = rand() % 258 + 1;
1125 }
1126 }
1127 }
1128 else
1129 {
1130 while ( 1 )
1131 {
1132 v23 = pParty->field_750[v12];
1133 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
1134 {
1135 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
1136 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
1137 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
1138 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
1139 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
1140 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
1141 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
1142 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
1143 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
1144 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
1145 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
1146 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
1147 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
1148 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
1149 break;
1150 }
1151 pParty->field_750[v12] = rand() % 258 + 1;
1152 }
1153 }
1154 }
1155 else
1156 {
1157 while ( 1 )
1158 {
1159 v24 = pParty->field_750[v12];
1160 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
1161 {
1162 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
1163 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1164 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1165 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1166 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1167 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1168 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
1169 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
1170 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1171 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
1172 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
1173 break;
1174 }
1175 pParty->field_750[v12] = rand() % 258 + 1;
1176 }
1177 }
1178 v10 = v56;
1179 }
1180 v25 = v10;
1181 v26 = pParty->field_750[v25];
1182 v27 = pParty->field_75A[v25] == v13;
1183 word_F8B1A0 = pParty->field_750[v25];
1184 if ( v27 )
1185 {
1186 //v1 = 0;
1187 v27 = v26 == v13;
1188 v29 = (int)pNPCTopics[351].pText;
1189 if ( v27 )
1190 v29 = (int)pNPCTopics[353].pText;
1191 dword_F8B1A4 = (char *)v29;
1192 }
1193 else
1194 {
1195 if ( v26 != v13 )
1196 {
1197 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
1198 v28 = pParty->pPlayers;
1199 do
1200 {
1201 v28->SetVariable(VAR_Award, 86);
1202 ++v28;
1203 }
1204 while ( (signed int)v28 < (signed int)pParty->pHirelings );
1205 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
1206 pParty->field_750[v25] = v13;
1207 pParty->field_75A[v25] = v13;
1208 }
1209 //v1 = 0;
1210 dword_F8B1A4 = pNPCTopics[352].pText;
1211 }
1212 }
1213 else if ( uMessageParam == 100 )
1214 {
1215 pKeyActionMap->EnterText(1, 10, v8);
1216 }
1217 break;
1218 }
1219 case 22:
1220 {
1221 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
1222 pKeyActionMap->EnterText(1, 10, v8);
1223 return;
1224 break;
1225 }
1226 case 1:
1227 case 2:
1228 case 3:
1229 case 4:
1230 case 21:
1231 case 23:
1232 case 30:
1233 {
1234 break;
1235 }
1236 default:
1237 {
1238 return;
1239 break;
1240 }
1241 }
1242
1243 /*
961 if ( in_current_building_type > BildingType_Tavern ) 1244 if ( in_current_building_type > BildingType_Tavern )
962 { 1245 {
963 if ( in_current_building_type == BildingType_Bank ) 1246 if ( in_current_building_type == BildingType_Bank )
964 { 1247 {
965 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 ) 1248 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
967 return; 1250 return;
968 } 1251 }
969 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training ) 1252 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
970 return; 1253 return;
971 } 1254 }
972 else 1255 //else
973 { 1256 if ( in_current_building_type < BildingType_Tavern )
974 if ( in_current_building_type != BildingType_Tavern ) 1257 {
975 {
976 if (in_current_building_type <= 0) 1258 if (in_current_building_type <= 0)
977 return; 1259 return;
978 if ( in_current_building_type > BildingType_AlchemistShop ) 1260 if ( in_current_building_type > BildingType_AlchemistShop )
979 { 1261 {
980 if ( in_current_building_type <= BildingType_16 ) 1262 if ( in_current_building_type <= BildingType_16 )
1012 } 1294 }
1013 return; 1295 return;
1014 } 1296 }
1015 if ( in_current_building_type != BildingType_TownHall ) 1297 if ( in_current_building_type != BildingType_TownHall )
1016 return; 1298 return;
1017 if ( uMessageParam == 99 ) 1299 if ( in_current_building_type == BildingType_TownHall )
1018 { 1300 {
1019 v10 = (int)((char *)v8->ptr_1C - 102); 1301 if ( uMessageParam == 99 )
1020 v56 = v10; 1302 {
1021 v11 = 8 * v10 + 11325428; 1303 v10 = (int)((char *)v8->ptr_1C - 102);
1022 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed ) 1304 v56 = v10;
1023 { 1305 v11 = 8 * v10 + 11325428;
1024 v13 = 0; 1306 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
1025 } 1307 {
1026 else 1308 v13 = 0;
1027 { 1309 }
1028 v12 = v10; 1310 else
1029 v13 = 0; 1311 {
1030 pParty->field_75A[v12] = 0; 1312 v12 = v10;
1031 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); 1313 v13 = 0;
1032 v14 = rand() % 258; 1314 pParty->field_75A[v12] = 0;
1033 v15 = window_SpeakInHouse; 1315 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
1034 pParty->field_750[v12] = v14 + 1; 1316 v14 = rand() % 258;
1035 v16 = (int)((char *)v15->ptr_1C - 102); 1317 v15 = window_SpeakInHouse;
1036 if ( v16 ) 1318 pParty->field_750[v12] = v14 + 1;
1037 { 1319 v16 = (int)((char *)v15->ptr_1C - 102);
1038 v17 = v16 - 1; 1320 if ( v16 )
1039 if ( v17 ) 1321 {
1040 { 1322 v17 = v16 - 1;
1041 v18 = v17 - 1; 1323 if ( v17 )
1042 if ( v18 ) 1324 {
1043 { 1325 v18 = v17 - 1;
1044 v19 = v18 - 1; 1326 if ( v18 )
1045 if ( v19 ) 1327 {
1046 { 1328 v19 = v18 - 1;
1047 if ( v19 == 1 ) 1329 if ( v19 )
1048 { 1330 {
1049 while ( 1 ) 1331 if ( v19 == 1 )
1050 { 1332 {
1051 v20 = pParty->field_750[v12]; 1333 while ( 1 )
1052 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u ) 1334 {
1053 { 1335 v20 = pParty->field_750[v12];
1054 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u) 1336 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
1055 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u) 1337 {
1056 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu) 1338 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
1057 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u) 1339 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
1058 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u) 1340 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
1059 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du) 1341 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
1060 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu) 1342 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
1061 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u) 1343 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
1062 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u) 1344 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
1063 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu) 1345 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
1064 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u) 1346 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
1065 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u) 1347 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
1066 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u) 1348 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
1067 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du) 1349 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
1068 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu) 1350 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
1069 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu) 1351 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
1070 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u) 1352 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
1071 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) ) 1353 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
1072 break; 1354 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
1073 } 1355 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
1074 pParty->field_750[v12] = rand() % 258 + 1; 1356 break;
1075 } 1357 }
1076 } 1358 pParty->field_750[v12] = rand() % 258 + 1;
1077 } 1359 }
1078 else 1360 }
1079 { 1361 }
1080 while ( 1 ) 1362 else
1081 { 1363 {
1082 v21 = pParty->field_750[v12]; 1364 while ( 1 )
1083 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u ) 1365 {
1084 { 1366 v21 = pParty->field_750[v12];
1085 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u) 1367 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
1086 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u) 1368 {
1087 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu) 1369 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
1088 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u) 1370 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
1089 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u) 1371 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
1090 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du) 1372 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
1091 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u) 1373 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
1092 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u) 1374 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
1093 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u) 1375 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
1094 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u) 1376 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
1095 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u) 1377 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
1096 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu) 1378 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
1097 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u) 1379 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
1098 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) ) 1380 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
1099 break; 1381 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
1100 } 1382 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
1101 pParty->field_750[v12] = rand() % 258 + 1; 1383 break;
1102 } 1384 }
1103 } 1385 pParty->field_750[v12] = rand() % 258 + 1;
1104 } 1386 }
1105 else 1387 }
1106 { 1388 }
1107 while ( 1 ) 1389 else
1108 { 1390 {
1109 v22 = pParty->field_750[v12]; 1391 while ( 1 )
1110 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u ) 1392 {
1111 { 1393 v22 = pParty->field_750[v12];
1112 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u) 1394 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
1113 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u) 1395 {
1114 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu) 1396 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
1115 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u) 1397 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
1116 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u) 1398 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
1117 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du) 1399 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
1118 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u) 1400 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
1119 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u) 1401 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
1120 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu) 1402 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
1121 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u) 1403 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
1122 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) ) 1404 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
1123 break; 1405 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
1124 } 1406 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
1125 pParty->field_750[v12] = rand() % 258 + 1; 1407 break;
1126 } 1408 }
1127 } 1409 pParty->field_750[v12] = rand() % 258 + 1;
1128 } 1410 }
1129 else 1411 }
1130 { 1412 }
1131 while ( 1 ) 1413 else
1132 { 1414 {
1133 v23 = pParty->field_750[v12]; 1415 while ( 1 )
1134 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u ) 1416 {
1135 { 1417 v23 = pParty->field_750[v12];
1136 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u) 1418 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
1137 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u) 1419 {
1138 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu) 1420 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
1139 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u) 1421 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
1140 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u) 1422 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
1141 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du) 1423 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
1142 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u) 1424 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
1143 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u) 1425 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
1144 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u) 1426 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
1145 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu) 1427 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
1146 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu) 1428 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
1147 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu) 1429 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
1148 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u) 1430 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
1149 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) ) 1431 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
1150 break; 1432 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
1151 } 1433 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
1152 pParty->field_750[v12] = rand() % 258 + 1; 1434 break;
1153 } 1435 }
1154 } 1436 pParty->field_750[v12] = rand() % 258 + 1;
1155 } 1437 }
1156 else 1438 }
1157 { 1439 }
1158 while ( 1 ) 1440 else
1159 { 1441 {
1160 v24 = pParty->field_750[v12]; 1442 while ( 1 )
1161 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u ) 1443 {
1162 { 1444 v24 = pParty->field_750[v12];
1163 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu) 1445 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
1164 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u) 1446 {
1165 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu) 1447 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
1166 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u) 1448 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1167 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u) 1449 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1168 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du) 1450 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1169 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu) 1451 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1170 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u) 1452 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1171 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu) 1453 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
1172 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu) 1454 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
1173 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) ) 1455 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1174 break; 1456 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
1175 } 1457 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
1176 pParty->field_750[v12] = rand() % 258 + 1; 1458 break;
1177 } 1459 }
1178 } 1460 pParty->field_750[v12] = rand() % 258 + 1;
1179 v10 = v56; 1461 }
1180 } 1462 }
1181 v25 = v10; 1463 v10 = v56;
1182 v26 = pParty->field_750[v25]; 1464 }
1183 v27 = pParty->field_75A[v25] == v13; 1465 v25 = v10;
1184 word_F8B1A0 = pParty->field_750[v25]; 1466 v26 = pParty->field_750[v25];
1185 if ( v27 ) 1467 v27 = pParty->field_75A[v25] == v13;
1186 { 1468 word_F8B1A0 = pParty->field_750[v25];
1187 //v1 = 0; 1469 if ( v27 )
1188 v27 = v26 == v13; 1470 {
1189 v29 = (int)pNPCTopics[351].pText; 1471 //v1 = 0;
1190 if ( v27 ) 1472 v27 = v26 == v13;
1191 v29 = (int)pNPCTopics[353].pText; 1473 v29 = (int)pNPCTopics[351].pText;
1192 dword_F8B1A4 = (char *)v29; 1474 if ( v27 )
1193 } 1475 v29 = (int)pNPCTopics[353].pText;
1194 else 1476 dword_F8B1A4 = (char *)v29;
1195 { 1477 }
1196 if ( v26 != v13 ) 1478 else
1197 { 1479 {
1198 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0); 1480 if ( v26 != v13 )
1199 v28 = pParty->pPlayers; 1481 {
1200 do 1482 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
1201 { 1483 v28 = pParty->pPlayers;
1202 v28->SetVariable(VAR_Award, 86); 1484 do
1203 ++v28; 1485 {
1204 } 1486 v28->SetVariable(VAR_Award, 86);
1205 while ( (signed int)v28 < (signed int)pParty->pHirelings ); 1487 ++v28;
1206 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel; 1488 }
1207 pParty->field_750[v25] = v13; 1489 while ( (signed int)v28 < (signed int)pParty->pHirelings );
1208 pParty->field_75A[v25] = v13; 1490 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
1209 } 1491 pParty->field_750[v25] = v13;
1210 //v1 = 0; 1492 pParty->field_75A[v25] = v13;
1211 dword_F8B1A4 = pNPCTopics[352].pText; 1493 }
1212 } 1494 //v1 = 0;
1213 } 1495 dword_F8B1A4 = pNPCTopics[352].pText;
1214 else if ( uMessageParam == 100 ) 1496 }
1215 { 1497 }
1216 pKeyActionMap->EnterText(1, 10, v8); 1498 else if ( uMessageParam == 100 )
1217 } 1499 {
1218 } 1500 pKeyActionMap->EnterText(1, 10, v8);
1219 } 1501 }
1220 } 1502 }
1221 if ( uMessageParam > 95 ) 1503 }
1222 { 1504 }
1505 */
1506
1507
1223 //LABEL_196: 1508 //LABEL_196:
1224 switch ( uMessageParam ) 1509 switch ( uMessageParam )
1225 { 1510 {
1226 case 96: 1511 case 96:
1512 {
1227 pDialogueWindow->eWindowType = WINDOW_MainMenu; 1513 pDialogueWindow->eWindowType = WINDOW_MainMenu;
1228 UI_CreateEndConversationButton(); 1514 UI_CreateEndConversationButton();
1229 FillAviableSkillsToTeach(in_current_building_type); 1515 FillAviableSkillsToTeach(in_current_building_type);
1230 break; 1516 break;
1231 case 101: 1517 }
1518 case 101:
1519 {
1232 pDialogueWindow->eWindowType = WINDOW_MainMenu; 1520 pDialogueWindow->eWindowType = WINDOW_MainMenu;
1233 UI_CreateEndConversationButton(); 1521 UI_CreateEndConversationButton();
1234 sub_4B3A72(in_current_building_type); 1522 sub_4B3A72(in_current_building_type);
1235 break; 1523 break;
1236 case 102: 1524 }
1237 dialog_menu_id = 102; 1525 case 102:
1526 case 103:
1527 {
1528 dialog_menu_id = uMessageParam;
1238 break; 1529 break;
1239 case 103: 1530 }
1240 dialog_menu_id = 103; 1531 case 104:
1241 break; 1532 {
1242 case 104:
1243 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 1533 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
1244 { 1534 {
1245 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29; 1535 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
1246 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1; 1536 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
1247 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; 1537 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
1248 ++pMessageQueue_50CBD0->uNumMessages; 1538 ++pMessageQueue_50CBD0->uNumMessages;
1249 }*/ 1539 }*/
1250 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0); 1540 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
1251 dialog_menu_id = 104; 1541 dialog_menu_id = 104;
1252 break; 1542 break;
1253 } 1543 }
1254 return; 1544 case 2:
1255 } 1545 case 95:
1546 {
1547 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
1548 {
1549 GenerateStandartShopItems();
1550 GenerateSpecialShopItems();
1551 v8 = window_SpeakInHouse;
1552 v40 = window_SpeakInHouse->par1C;
1553 //v3 = dword_F8B198;
1554 v41 = pParty->uTimePlayed
1555 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
1556 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
1557 * 0.033333335);
1558 pParty->field_3C.field_50[v40] = v41;
1559 }
1560 v42 = v8->ptr_1C;
1561 v43 = 0;
1562 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
1563 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
1564 if ( uMessageParam == 2 )
1565 {
1566 if ( uItemsAmountPerShopType[v44] )
1567 {
1568 do
1569 {
1570 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
1571 if ( v45 )
1572 {
1573 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
1574 //v3 = dword_F8B198;
1575 v8 = window_SpeakInHouse;
1576 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
1577 }
1578 v42 = v8->ptr_1C;
1579 ++v43;
1580 }
1581 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1582 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
1583 }
1584 if ( in_current_building_type == BildingType_WeaponShop )
1585 {
1586 v47 = v8->ptr_1C;
1587 v48 = 0;
1588 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
1589 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
1590 {
1591 do
1592 {
1593 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
1594 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
1595 {
1596 v49 = rand();
1597 v8 = window_SpeakInHouse;
1598 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
1599 }
1600 v47 = v8->ptr_1C;
1601 ++v48;
1602 }
1603 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1604 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
1605 }
1606 }
1607 }
1608 if ( uMessageParam == 95 )
1609 {
1610 if ( uItemsAmountPerShopType[v44] )
1611 {
1612 do
1613 {
1614 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
1615 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
1616 if ( v50 )
1617 {
1618 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
1619 //v3 = dword_F8B198;
1620 v8 = window_SpeakInHouse;
1621 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
1622 }
1623 v42 = v8->ptr_1C;
1624 ++v43;
1625 }
1626 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1627 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
1628 }
1629 if ( in_current_building_type == BildingType_WeaponShop )
1630 {
1631 v52 = v8->ptr_1C;
1632 v53 = 0;
1633 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
1634 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
1635 {
1636 do
1637 {
1638 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
1639 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
1640 {
1641 v54 = rand();
1642 v8 = window_SpeakInHouse;
1643 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
1644 }
1645 v52 = v8->ptr_1C;
1646 ++v53;
1647 }
1648 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1649 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
1650 }
1651 }
1652 }
1653 break;
1654 }
1655 case 3:
1656 case 4:
1657 case 5:
1658 {
1659 dialog_menu_id = uMessageParam;
1660 sub_421B2C_PlaceInInventory_or_DropPickedItem();
1661 break;
1662 }
1663 case 94:
1664 {
1665 pDialogueWindow->eWindowType = WINDOW_MainMenu;
1666 UI_CreateEndConversationButton();
1667 sub_4B3AD4(in_current_building_type);
1668 break;
1669 }
1670 default:
1671 {
1672 if( uMessageParam >= 36 && uMessageParam <= 72 )
1673 {
1674 v35 = pPlayers[uActiveCharacter];
1675 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
1676 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
1677 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
1678 if ( v37 < v36 / 3 )
1679 v37 = v36 / 3;
1680
1681 __debugbreak();
1682 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
1683 // or
1684 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
1685 // or
1686 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
1687
1688 if (false)
1689 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
1690 {
1691 v38 = (int)(&v35->uIntelligence + uMessageParam);
1692 if ( !*(short *)v38 )
1693 {
1694 if ( pParty->uNumGold < v37 )
1695 {
1696 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
1697 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
1698 v39 = 4;
1699 else
1700 v39 = 2;
1701 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
1702 }
1703 else
1704 {
1705 Party::TakeGold(v37);
1706 dword_F8B1E4 = 1;
1707 *(short *)v38 = 1;
1708 v35->PlaySound(SPEECH_78, 0);
1709 }
1710 }
1711 }
1712 }
1713 break;
1714 }
1715 }
1716 /*
1256 if ( uMessageParam != 95 && uMessageParam != 2 ) 1717 if ( uMessageParam != 95 && uMessageParam != 2 )
1257 { 1718 {
1258 if ( uMessageParam == 3 ) 1719 if ( uMessageParam == 3 )
1259 { 1720 {
1260 dialog_menu_id = 3; 1721 dialog_menu_id = 3;
1390 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 1851 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1391 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ); 1852 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
1392 } 1853 }
1393 } 1854 }
1394 } 1855 }
1395 else 1856 if ( uMessageParam == 95 )
1396 { 1857 {
1397 if ( uItemsAmountPerShopType[v44] ) 1858 if ( uItemsAmountPerShopType[v44] )
1398 { 1859 {
1399 do 1860 do
1400 { 1861 {
1435 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 1896 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
1436 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] ); 1897 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
1437 } 1898 }
1438 } 1899 }
1439 } 1900 }
1901 */
1440 } 1902 }
1441 1903
1442 //----- (004BD8B5) -------------------------------------------------------- 1904 //----- (004BD8B5) --------------------------------------------------------
1443 signed int __cdecl sub_4BD8B5() 1905 signed int __cdecl sub_4BD8B5()
1444 { 1906 {