comparison UI/UIShops.cpp @ 1411:2423bc2af692

+InitializaDialogueOptions +InitializaDialogueOptions_Shops +InitializaDialogueOptions_Tavern
author Nomad
date Fri, 26 Jul 2013 23:35:34 +0200
parents 38df78aba732
children c7489dd19f88
comparison
equal deleted inserted replaced
1410:38df78aba732 1411:2423bc2af692
231 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; 231 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
232 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 232 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
233 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60]; 233 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];
234 if ( !v56 || !Str ) 234 if ( !v56 || !Str )
235 { 235 {
236 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2); 236 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2);
237 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 237 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
238 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 238 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
239 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); 239 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
240 } 240 }
241 else 241 else
265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), 265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) 267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
268 return; 268 return;
269 v79 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; 269 v79 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
270 v13 = pPlayer->SelectPhrasesTransaction(v79, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); 270 v13 = pPlayer->SelectPhrasesTransaction(v79, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3);
271 v7 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 271 v7 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); 273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
274 break; 274 break;
275 } 275 }
286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) 286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
287 return; 287 return;
288 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; 288 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
289 if (!v4->Identified()) 289 if (!v4->Identified())
290 { 290 {
291 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); 291 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4);
292 v7 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 292 v7 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
294 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); 294 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
295 } 295 }
296 else 296 else
313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) 314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) ) 315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
316 return; 316 return;
317 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; 317 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
318 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); 318 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
319 v7 = BuildDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 319 v7 = BuildDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138; 320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3); 321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
322 return; 322 return;
323 } 323 }
422 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; 422 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
423 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 423 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
424 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; 424 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
425 if ( !v56 || !Str ) 425 if ( !v56 || !Str )
426 { 426 {
427 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2); 427 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2);
428 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 428 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
429 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 429 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
430 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); 430 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
431 } 431 }
432 else 432 else
759 if ( !v74 ) 759 if ( !v74 )
760 return; 760 return;
761 pItemCount = v74 - 1; 761 pItemCount = v74 - 1;
762 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1]; 762 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
763 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0) 763 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0)
764 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)]; 764 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
765 else 765 else
766 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24" 766 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
767 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 767 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
768 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 768 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
769 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 769 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
831 if ( dialog_menu_id == 2 ) 831 if ( dialog_menu_id == 2 )
832 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74 - 1]; 832 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
833 else 833 else
834 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74 - 1]; 834 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
835 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 ) 835 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
836 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)]; 836 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
837 else 837 else
838 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24" 838 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
839 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 839 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
840 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 840 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
841 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 841 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
893 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), 893 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
894 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 894 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
895 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) ) 895 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) )
896 return; 896 return;
897 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v10 - 1]; 897 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v10 - 1];
898 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3); 898 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3);
899 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3)]; 899 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)];
900 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0); 900 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
901 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 901 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
902 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 902 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
903 return; 903 return;
904 } 904 }
922 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v2-1]; 922 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v2-1];
923 if (v3->Identified()) 923 if (v3->Identified())
924 v5 = "%24"; 924 v5 = "%24";
925 else 925 else
926 { 926 {
927 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4); 927 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4);
928 v5 = (char *)pMerchantsIdentifyPhrases[v8]; 928 v5 = (char *)pMerchantsIdentifyPhrases[v8];
929 } 929 }
930 v6 = BuildDialogueString(v5, uActiveCharacter - 1, v3, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 930 v6 = BuildDialogueString(v5, uActiveCharacter - 1, v3, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
931 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138; 931 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
932 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v6, 3); 932 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v6, 3);
951 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32) 951 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
952 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) ) 952 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
953 return; 953 return;
954 __debugbreak(); // warning C4700: uninitialized local variable 'v33' used 954 __debugbreak(); // warning C4700: uninitialized local variable 'v33' used
955 v116 = &pPlayers[uActiveCharacter]->pInventoryItemList[v33 - 1]; 955 v116 = &pPlayers[uActiveCharacter]->pInventoryItemList[v33 - 1];
956 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5); 956 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1], BuildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
957 v15 = (char *)pMerchantsRepairPhrases[v35]; 957 v15 = (char *)pMerchantsRepairPhrases[v35];
958 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 958 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
959 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 959 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
960 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 960 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
961 return; 961 return;
979 if ( pItemCount && pItemCount != -65536 ) 979 if ( pItemCount && pItemCount != -65536 )
980 { 980 {
981 --pItemCount; 981 --pItemCount;
982 v97 = uActiveCharacter - 1; 982 v97 = uActiveCharacter - 1;
983 __debugbreak(); // warning C4700: uninitialized local variable 'v98' used 983 __debugbreak(); // warning C4700: uninitialized local variable 'v98' used
984 v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 2); 984 v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2);
985 v100 = BuildDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0); 985 v100 = BuildDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0);
986 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0); 986 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
987 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, pWhiteColor, v100, 3); 987 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, pWhiteColor, v100, 3);
988 } 988 }
989 v104 = 0; 989 v104 = 0;
1362 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67]; 1362 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
1363 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 1363 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1364 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; 1364 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
1365 if ( !v63 || !Str ) 1365 if ( !v63 || !Str )
1366 { 1366 {
1367 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); 1367 v71 = pPlayer->SelectPhrasesTransaction(v70, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2);
1368 v38 = (char *)pMerchantsBuyPhrases[v71]; 1368 v38 = (char *)pMerchantsBuyPhrases[v71];
1369 } 1369 }
1370 else 1370 else
1371 { 1371 {
1372 v38 = pGlobalTXT_LocalizationStrings[181]; 1372 v38 = pGlobalTXT_LocalizationStrings[181];
1389 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), 1389 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
1390 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 1390 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
1391 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) 1391 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
1392 return; 1392 return;
1393 v87 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; 1393 v87 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1394 v45 = pPlayer->SelectPhrasesTransaction(v87, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3); 1394 v45 = pPlayer->SelectPhrasesTransaction(v87, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3);
1395 v21 = BuildDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 1395 v21 = BuildDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
1396 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0); 1396 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
1397 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3); 1397 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
1398 return; 1398 return;
1399 } 1399 }
1409 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) 1409 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
1410 return; 1410 return;
1411 v37 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; 1411 v37 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1412 if (!v37->Identified()) 1412 if (!v37->Identified())
1413 { 1413 {
1414 v42 = pPlayer->SelectPhrasesTransaction(v37, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4); 1414 v42 = pPlayer->SelectPhrasesTransaction(v37, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4);
1415 v38 = (char *)pMerchantsIdentifyPhrases[v42]; 1415 v38 = (char *)pMerchantsIdentifyPhrases[v42];
1416 } 1416 }
1417 else 1417 else
1418 { 1418 {
1419 v38 = "%24"; 1419 v38 = "%24";
1565 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; 1565 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
1566 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 1566 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1567 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; 1567 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
1568 if ( !v63 || !Str ) 1568 if ( !v63 || !Str )
1569 { 1569 {
1570 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, v68, 2); 1570 v71 = pPlayer->SelectPhrasesTransaction(v70, BuildingType_AlchemistShop, v68, 2);
1571 v38 = (char *)pMerchantsBuyPhrases[v71]; 1571 v38 = (char *)pMerchantsBuyPhrases[v71];
1572 } 1572 }
1573 else 1573 else
1574 { 1574 {
1575 v38 = pGlobalTXT_LocalizationStrings[181]; 1575 v38 = pGlobalTXT_LocalizationStrings[181];
1945 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; 1945 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
1946 if ( v67 && Str ) 1946 if ( v67 && Str )
1947 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 1947 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
1948 else 1948 else
1949 { 1949 {
1950 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); 1950 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
1951 v10 = (char *)pMerchantsBuyPhrases[v75]; 1951 v10 = (char *)pMerchantsBuyPhrases[v75];
1952 } 1952 }
1953 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 1953 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1954 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 1954 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
1955 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 1955 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2076 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; 2076 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
2077 if ( v67 && Str ) 2077 if ( v67 && Str )
2078 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 2078 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
2079 else 2079 else
2080 { 2080 {
2081 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); 2081 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
2082 v10 = (char *)pMerchantsBuyPhrases[v75]; 2082 v10 = (char *)pMerchantsBuyPhrases[v75];
2083 } 2083 }
2084 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); 2084 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
2085 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 2085 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
2086 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 2086 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2140 *(int *)result <= 13) 2140 *(int *)result <= 13)
2141 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) 2141 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
2142 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) 2142 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
2143 return; 2143 return;
2144 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1]; 2144 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
2145 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); 2145 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3);
2146 v30 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 2146 v30 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
2147 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 2147 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
2148 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 2148 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2149 return; 2149 return;
2150 } 2150 }
2172 v5 = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 2172 v5 = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
2173 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; 2173 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
2174 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); 2174 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3);
2175 return; 2175 return;
2176 } 2176 }
2177 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); 2177 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4);
2178 v30 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 2178 v30 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
2179 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138; 2179 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138;
2180 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3); 2180 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3);
2181 return; 2181 return;
2182 } 2182 }
2199 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) 2199 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
2200 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) 2200 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
2201 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) ) 2201 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
2202 return; 2202 return;
2203 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1]; 2203 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
2204 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); 2204 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[result - 1], BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);
2205 v30 = BuildDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 2205 v30 = BuildDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
2206 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 2206 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
2207 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 2207 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2208 return; 2208 return;
2209 } 2209 }
2560 if ( !*pSkill ) 2560 if ( !*pSkill )
2561 { 2561 {
2562 if ( pParty->uNumGold < uPriceItemService ) 2562 if ( pParty->uNumGold < uPriceItemService )
2563 { 2563 {
2564 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" 2564 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
2565 if ( in_current_building_type == BildingType_Training ) 2565 if ( in_current_building_type == BuildingType_Training )
2566 v55 = 4; 2566 v55 = 4;
2567 else 2567 else
2568 v55 = 2; 2568 v55 = 2;
2569 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v55); 2569 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v55);
2570 return; 2570 return;
2602 POINT v16; // [sp+38h] [bp-14h]@5 2602 POINT v16; // [sp+38h] [bp-14h]@5
2603 POINT a2; // [sp+40h] [bp-Ch]@5 2603 POINT a2; // [sp+40h] [bp-Ch]@5
2604 2604
2605 if ( in_current_building_type <= 0 ) 2605 if ( in_current_building_type <= 0 )
2606 return; 2606 return;
2607 if ( in_current_building_type <= BildingType_AlchemistShop ) 2607 if ( in_current_building_type <= BuildingType_AlchemistShop )
2608 { 2608 {
2609 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 2609 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2610 { 2610 {
2611 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 2611 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2612 return; 2612 return;
2633 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 2633 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
2634 v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5 - 1]; 2634 v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5 - 1];
2635 GameUI_DrawItemInfo(v7); 2635 GameUI_DrawItemInfo(v7);
2636 return; 2636 return;
2637 } 2637 }
2638 if ( in_current_building_type <= BildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) 2638 if ( in_current_building_type <= BuildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS )
2639 { 2639 {
2640 v1 = pMouse->GetCursorPos(&a2); 2640 v1 = pMouse->GetCursorPos(&a2);
2641 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; 2641 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
2642 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 2642 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
2643 v5 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 2643 v5 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
2652 signed int v5; // edi@20 2652 signed int v5; // edi@20
2653 int v7[4]; // [sp+Ch] [bp-10h]@12 2653 int v7[4]; // [sp+Ch] [bp-10h]@12
2654 2654
2655 if ( in_current_building_type > 0 ) 2655 if ( in_current_building_type > 0 )
2656 { 2656 {
2657 if ( in_current_building_type > BildingType_MagicShop ) 2657 if ( in_current_building_type > BuildingType_MagicShop )
2658 { 2658 {
2659 if ( in_current_building_type == BildingType_Bank ) 2659 if ( in_current_building_type == BuildingType_Bank )
2660 { 2660 {
2661 if ( !dword_F8B1E4 ) 2661 if ( !dword_F8B1E4 )
2662 return; 2662 return;
2663 } 2663 }
2664 else 2664 else
2665 { 2665 {
2666 if ( in_current_building_type != BildingType_Temple ) 2666 if ( in_current_building_type != BuildingType_Temple )
2667 return; 2667 return;
2668 } 2668 }
2669 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2); 2669 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
2670 return; 2670 return;
2671 } 2671 }