comparison mm7_2.cpp @ 471:c43f156a95c9

ArmorShopDialog crash fixed. All shops show its items
author Gloval
date Mon, 25 Feb 2013 23:33:15 +0400
parents fcdaa804074f
children 7dfe960c323c 7f1b00901cf7
comparison
equal deleted inserted replaced
470:fcdaa804074f 471:c43f156a95c9
1208 { 1208 {
1209 if ( dword_F8B19C == 5 ) 1209 if ( dword_F8B19C == 5 )
1210 { 1210 {
1211 draw_leather(); 1211 draw_leather();
1212 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1212 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1213 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0); 1213 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
1214 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1214 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1215 if ( result ) 1215 if ( result )
1216 { 1216 {
1217 v27 = pMouse->GetCursorPos(&v99)->x - 14; 1217 v27 = pMouse->GetCursorPos(&v99)->x - 14;
1218 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5); 1218 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5);
1309 { 1309 {
1310 if ( dword_F8B19C == 3 ) 1310 if ( dword_F8B19C == 3 )
1311 { 1311 {
1312 draw_leather(); 1312 draw_leather();
1313 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1313 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1314 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0); 1314 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1315 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1315 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1316 if ( result ) 1316 if ( result )
1317 { 1317 {
1318 v11 = pMouse->GetCursorPos(&v96)->x - 14; 1318 v11 = pMouse->GetCursorPos(&v96)->x - 14;
1319 v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5); 1319 v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5);
1347 result = (char *)(dword_F8B19C - 4); 1347 result = (char *)(dword_F8B19C - 4);
1348 if ( dword_F8B19C == 4 ) 1348 if ( dword_F8B19C == 4 )
1349 { 1349 {
1350 draw_leather(); 1350 draw_leather();
1351 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1351 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1352 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0); 1352 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1353 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1353 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1354 if ( result ) 1354 if ( result )
1355 { 1355 {
1356 v2 = pMouse->GetCursorPos(&a2)->x - 14; 1356 v2 = pMouse->GetCursorPos(&a2)->x - 14;
1357 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5); 1357 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5);
1415 { 1415 {
1416 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) 1416 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
1417 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID); 1417 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID);
1418 { 1418 {
1419 v49 = word_F8B158[(signed int)v48]; 1419 v49 = word_F8B158[(signed int)v48];
1420 v50 = dword_F8B168[(signed int)v48]; 1420 v50 = ItemsInShopTexture[(signed int)v48];
1421 v49 += 30; 1421 v49 += 30;
1422 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); 1422 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
1423 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50); 1423 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
1424 sub_40F92A( 1424 sub_40F92A(
1425 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49], 1425 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
1426 dword_F8B168[(signed int)v109], 1426 ItemsInShopTexture[(signed int)v109],
1427 (int)((char *)v109 + 1)); 1427 (int)((char *)v109 + 1));
1428 v48 = v109; 1428 v48 = v109;
1429 } 1429 }
1430 v108 += 70; 1430 v108 += 70;
1431 v48 = (const char **)((char *)v48 + 1); 1431 v48 = (const char **)((char *)v48 + 1);
1441 { 1441 {
1442 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) 1442 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
1443 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) 1443 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
1444 { 1444 {
1445 v52 = word_F8B158[(signed int)v109] + 30; 1445 v52 = word_F8B158[(signed int)v109] + 30;
1446 v53 = dword_F8B168[(signed int)v109]; 1446 v53 = ItemsInShopTexture[(signed int)v109];
1447 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); 1447 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
1448 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); 1448 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
1449 sub_40F92A( 1449 sub_40F92A(
1450 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52], 1450 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
1451 dword_F8B168[(signed int)v109], 1451 ItemsInShopTexture[(signed int)v109],
1452 (int)((char *)v109 + 1)); 1452 (int)((char *)v109 + 1));
1453 } 1453 }
1454 v109 = (const char **)((char *)v109 + 1); 1454 v109 = (const char **)((char *)v109 + 1);
1455 v108 += 70; 1455 v108 += 70;
1456 } 1456 }
1494 { 1494 {
1495 v58 = pGlobalTXT_LocalizationStrings[195]; 1495 v58 = pGlobalTXT_LocalizationStrings[195];
1496 if ( dword_F8B19C != 2 ) 1496 if ( dword_F8B19C != 2 )
1497 v58 = pGlobalTXT_LocalizationStrings[196]; 1497 v58 = pGlobalTXT_LocalizationStrings[196];
1498 } 1498 }
1499 sub_4B46A5(v58, 0); 1499 DrawTextAtStatusBar(v58, 0);
1500 if ( v106.x ) 1500 if ( v106.x )
1501 { 1501 {
1502 v59 = pMouse->GetCursorPos(&v91); 1502 v59 = pMouse->GetCursorPos(&v91);
1503 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); 1503 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
1504 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) 1504 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
1530 goto LABEL_13; 1530 goto LABEL_13;
1531 } 1531 }
1532 } 1532 }
1533 else 1533 else
1534 { 1534 {
1535 result = v101._4B1854( 1535 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1536 __PAIR__( 1536 result =0; //added
1537 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1],
1538 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C])
1539 - pParty->uTimePlayed);
1540 } 1537 }
1541 } 1538 }
1542 return result; 1539 return result;
1543 } 1540 }
1544 1541
1730 { 1727 {
1731 if ( dword_F8B19C == 3 ) 1728 if ( dword_F8B19C == 3 )
1732 { 1729 {
1733 draw_leather(); 1730 draw_leather();
1734 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1731 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1735 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0); 1732 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1736 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1733 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1737 if ( !result 1734 if ( !result
1738 || (v43 = pMouse->GetCursorPos(&v99)->x - 14, 1735 || (v43 = pMouse->GetCursorPos(&v99)->x - 14,
1739 v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), 1736 v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
1740 result = pMouse->GetCursorPos(&v102), 1737 result = pMouse->GetCursorPos(&v102),
1755 } 1752 }
1756 if ( dword_F8B19C == 4 ) 1753 if ( dword_F8B19C == 4 )
1757 { 1754 {
1758 draw_leather(); 1755 draw_leather();
1759 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1756 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1760 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0); 1757 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1761 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1758 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1762 if ( !result 1759 if ( !result
1763 || (v36 = pMouse->GetCursorPos(&a2)->x - 14, 1760 || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
1764 v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5), 1761 v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
1765 result = pMouse->GetCursorPos(&v101), 1762 result = pMouse->GetCursorPos(&v101),
1955 do 1952 do
1956 { 1953 {
1957 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 1954 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
1958 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID); 1955 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
1959 { 1956 {
1960 v46 = dword_F8B168[v114]; 1957 v46 = ItemsInShopTexture[v114];
1961 v47 = 152 - v46->uTextureHeight; 1958 v47 = 152 - v46->uTextureHeight;
1962 if ( (signed int)v47 < 1 ) 1959 if ( (signed int)v47 < 1 )
1963 v47 = 0; 1960 v47 = 0;
1964 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40; 1961 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
1965 if ( v114 ) 1962 if ( v114 )
1966 { 1963 {
1967 if ( v114 == 5 ) 1964 if ( v114 == 5 )
1968 { 1965 {
1969 v49 = dword_F8B168[5]->uTextureWidth; 1966 v49 = ItemsInShopTexture[5]->uTextureWidth;
1970 if ( (signed int)v48 > 457 - v49 ) 1967 if ( (signed int)v48 > 457 - v49 )
1971 v48 = 457 - v49; 1968 v48 = 457 - v49;
1972 } 1969 }
1973 } 1970 }
1974 else 1971 else
1975 { 1972 {
1976 if ( (signed int)v48 < 18 ) 1973 if ( (signed int)v48 < 18 )
1977 v48 = 18; 1974 v48 = 18;
1978 } 1975 }
1979 pRenderer->DrawTextureTransparent(v48, v47, v46); 1976 pRenderer->DrawTextureTransparent(v48, v47, v46);
1980 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], dword_F8B168[v114], v114 + 1); 1977 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
1981 } 1978 }
1982 ++v114; 1979 ++v114;
1983 } 1980 }
1984 while ( v114 < 6 ); 1981 while ( v114 < 6 );
1985 v114 = 0; 1982 v114 = 0;
1986 do 1983 do
1987 { 1984 {
1988 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) 1985 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
1989 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID); 1986 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
1990 { 1987 {
1991 v50 = dword_F8B168[v114 + 6]; 1988 v50 = ItemsInShopTexture[v114 + 6];
1992 v51 = 308 - v50->uTextureHeight; 1989 v51 = 308 - v50->uTextureHeight;
1993 if ( (signed int)v51 < 1 ) 1990 if ( (signed int)v51 < 1 )
1994 v51 = 0; 1991 v51 = 0;
1995 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40; 1992 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
1996 if ( v114 ) 1993 if ( v114 )
1997 { 1994 {
1998 if ( v114 == 5 ) 1995 if ( v114 == 5 )
1999 { 1996 {
2000 v53 = dword_F8B168[11]->uTextureWidth; 1997 v53 = ItemsInShopTexture[11]->uTextureWidth;
2001 if ( (signed int)v52 > 457 - v53 ) 1998 if ( (signed int)v52 > 457 - v53 )
2002 v52 = 457 - v53; 1999 v52 = 457 - v53;
2003 } 2000 }
2004 } 2001 }
2005 else 2002 else
2006 { 2003 {
2007 if ( (signed int)v52 < 18 ) 2004 if ( (signed int)v52 < 18 )
2008 v52 = 18; 2005 v52 = 18;
2009 } 2006 }
2010 pRenderer->DrawTextureTransparent(v52, v51, v50); 2007 pRenderer->DrawTextureTransparent(v52, v51, v50);
2011 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v114 + 6], v114 + 7); 2008 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
2012 } 2009 }
2013 ++v114; 2010 ++v114;
2014 } 2011 }
2015 while ( v114 < 6 ); 2012 while ( v114 < 6 );
2016 } 2013 }
2019 do 2016 do
2020 { 2017 {
2021 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2018 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2022 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID) 2019 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
2023 { 2020 {
2024 v54 = dword_F8B168[v114]; 2021 v54 = ItemsInShopTexture[v114];
2025 v55 = 152 - v54->uTextureHeight; 2022 v55 = 152 - v54->uTextureHeight;
2026 if ( (signed int)v55 < 1 ) 2023 if ( (signed int)v55 < 1 )
2027 v55 = 0; 2024 v55 = 0;
2028 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40; 2025 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
2029 if ( v114 ) 2026 if ( v114 )
2030 { 2027 {
2031 if ( v114 == 5 ) 2028 if ( v114 == 5 )
2032 { 2029 {
2033 v57 = dword_F8B168[5]->uTextureWidth; 2030 v57 = ItemsInShopTexture[5]->uTextureWidth;
2034 if ( (signed int)v56 > 457 - v57 ) 2031 if ( (signed int)v56 > 457 - v57 )
2035 v56 = 457 - v57; 2032 v56 = 457 - v57;
2036 } 2033 }
2037 } 2034 }
2038 else 2035 else
2039 { 2036 {
2040 if ( (signed int)v56 < 18 ) 2037 if ( (signed int)v56 < 18 )
2041 v56 = 18; 2038 v56 = 18;
2042 } 2039 }
2043 pRenderer->DrawTextureTransparent(v56, v55, v54); 2040 pRenderer->DrawTextureTransparent(v56, v55, v54);
2044 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v114], v114 + 1); 2041 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
2045 } 2042 }
2046 ++v114; 2043 ++v114;
2047 } 2044 }
2048 while ( v114 < 6 ); 2045 while ( v114 < 6 );
2049 v114 = 0; 2046 v114 = 0;
2050 do 2047 do
2051 { 2048 {
2052 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak 2049 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak
2053 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid 2050 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
2054 { 2051 {
2055 v58 = dword_F8B168[v114 + 6]; 2052 v58 = ItemsInShopTexture[v114 + 6];
2056 v59 = 308 - v58->uTextureHeight; 2053 v59 = 308 - v58->uTextureHeight;
2057 if ( (signed int)v59 < 1 ) 2054 if ( (signed int)v59 < 1 )
2058 v59 = 0; 2055 v59 = 0;
2059 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40; 2056 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
2060 if ( v114 ) 2057 if ( v114 )
2061 { 2058 {
2062 if ( v114 == 5 ) 2059 if ( v114 == 5 )
2063 { 2060 {
2064 v61 = dword_F8B168[11]->uTextureWidth; 2061 v61 = ItemsInShopTexture[11]->uTextureWidth;
2065 if ( (signed int)v60 > 457 - v61 ) 2062 if ( (signed int)v60 > 457 - v61 )
2066 v60 = 457 - v61; 2063 v60 = 457 - v61;
2067 } 2064 }
2068 } 2065 }
2069 else 2066 else
2070 { 2067 {
2071 if ( (signed int)v60 < 18 ) 2068 if ( (signed int)v60 < 18 )
2072 v60 = 18; 2069 v60 = 18;
2073 } 2070 }
2074 pRenderer->DrawTextureTransparent(v60, v59, v58); 2071 pRenderer->DrawTextureTransparent(v60, v59, v58);
2075 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v114 + 6], v114 + 7); 2072 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
2076 } 2073 }
2077 ++v114; 2074 ++v114;
2078 } 2075 }
2079 while ( v114 < 6 ); 2076 while ( v114 < 6 );
2080 } 2077 }
2116 { 2113 {
2117 v65 = pGlobalTXT_LocalizationStrings[195]; 2114 v65 = pGlobalTXT_LocalizationStrings[195];
2118 if ( dword_F8B19C != 2 ) 2115 if ( dword_F8B19C != 2 )
2119 v65 = pGlobalTXT_LocalizationStrings[196]; 2116 v65 = pGlobalTXT_LocalizationStrings[196];
2120 } 2117 }
2121 sub_4B46A5(v65, 0); 2118 DrawTextAtStatusBar(v65, 0);
2122 if ( !v109 ) 2119 if ( !v109 )
2123 return (POINT *)v104._4B1854( 2120 {
2124 __PAIR__( 2121 v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
2125 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], 2122 return 0;
2126 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) 2123 }
2127 - pParty->uTimePlayed);
2128 v66 = pMouse->GetCursorPos(&v98); 2124 v66 = pMouse->GetCursorPos(&v98);
2129 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); 2125 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
2130 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) 2126 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
2131 { 2127 {
2132 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; 2128 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
2161 } 2157 }
2162 2158
2163 2159
2164 //----- (004BA928) -------------------------------------------------------- 2160 //----- (004BA928) --------------------------------------------------------
2165 void __cdecl ArmorShopDialog() 2161 void __cdecl ArmorShopDialog()
2166 { 2162 {
2167 Player *v0; // ebx@1 2163 Player *v0; // ebx@1
2168 signed int v1; // esi@8 2164 signed int v1; // esi@8
2169 unsigned int v2; // eax@10 2165 unsigned int v2; // eax@10
2170 ItemGen *v3; // eax@11 2166 ItemGen *v3; // eax@11
2171 unsigned __int8 v4; // dl@12 2167 unsigned __int8 v4; // dl@12
2172 char *v5; // ecx@12 2168 char *v5; // ecx@12
2173 char *v6; // eax@13 2169 char *v6; // eax@13
2174 int v7; // ST08_4@15 2170 int v7; // ST08_4@15
2175 int v8; // eax@15 2171 int v8; // eax@15
2176 signed int v9; // esi@17 2172 signed int v9; // esi@17
2177 unsigned int v10; // eax@19 2173 unsigned int v10; // eax@19
2178 char *v11; // edi@19 2174 char *v11; // edi@19
2179 int v12; // ST08_4@20 2175 int v12; // ST08_4@20
2180 int v13; // eax@20 2176 int v13; // eax@20
2181 unsigned __int8 v14; // dl@20 2177 unsigned __int8 v14; // dl@20
2182 char *v15; // ecx@20 2178 char *v15; // ecx@20
2183 char **v16; // edi@22 2179 char **v16; // edi@22
2184 int v17; // ebx@22 2180 int v17; // ebx@22
2185 char **v18; // esi@22 2181 char **v18; // esi@22
2186 int v19; // eax@23 2182 int v19; // eax@23
2187 GUIWindow *v20; // ecx@24 2183 GUIWindow *v20; // ecx@24
2188 int v21; // eax@24 2184 int v21; // eax@24
2189 int v22; // edx@24 2185 int v22; // edx@24
2190 int v23; // ebx@24 2186 int v23; // ebx@24
2191 unsigned __int8 v24; // sf@24 2187 unsigned __int8 v24; // sf@24
2192 GUIButton *v25; // eax@26 2188 GUIButton *v25; // eax@26
2193 GUIButton *v26; // esi@26 2189 GUIButton *v26; // esi@26
2194 int v27; // eax@26 2190 int v27; // eax@26
2195 unsigned int v28; // ecx@26 2191 unsigned int v28; // ecx@26
2196 Player *v29; // edx@26 2192 Player *v29; // edx@26
2197 unsigned __int16 v30; // ax@26 2193 unsigned __int16 v30; // ax@26
2198 signed int v31; // esi@31 2194 signed int v31; // esi@31
2199 unsigned int v32; // eax@33 2195 unsigned int v32; // eax@33
2200 int v33; // eax@34 2196 int v33; // eax@34
2201 int v34; // ST08_4@35 2197 int v34; // ST08_4@35
2202 int v35; // eax@35 2198 int v35; // eax@35
2203 char *v36; // edx@36 2199 char *v36; // edx@36
2204 GUIWindow *v37; // edi@42 2200 GUIWindow *v37; // edi@42
2205 signed int v38; // esi@42 2201 signed int v38; // esi@42
2206 unsigned int v39; // esi@44 2202 unsigned int v39; // esi@44
2207 int v40; // eax@44 2203 int v40; // eax@44
2208 unsigned int v41; // eax@45 2204 unsigned int v41; // eax@45
2209 int v42; // eax@47 2205 int v42; // eax@47
2210 int v43; // ecx@52 2206 int v43; // ecx@52
2211 GUIButton *v44; // eax@54 2207 GUIButton *v44; // eax@54
2212 GUIButton *v45; // esi@54 2208 GUIButton *v45; // esi@54
2213 int v46; // eax@54 2209 int v46; // eax@54
2214 char *v47; // eax@56 2210 char *v47; // eax@56
2215 int v48; // eax@56 2211 int v48; // eax@56
2216 unsigned int v49; // ecx@56 2212 unsigned int v49; // ecx@56
2217 int v50; // edx@56 2213 int v50; // edx@56
2218 int v51; // eax@56 2214 int v51; // eax@56
2219 unsigned __int16 v52; // ax@56 2215 unsigned __int16 v52; // ax@56
2220 int v53; // eax@60 2216 int v53; // eax@60
2221 int v54; // eax@60 2217 int v54; // eax@60
2222 signed int v55; // ebx@65 2218 signed int v55; // ebx@65
2223 Texture *v56; // eax@67 2219 Texture *v56; // eax@67
2224 unsigned int v57; // edi@68 2220 unsigned int v57; // edi@68
2225 Texture *v58; // ST1C_4@68 2221 Texture *v58; // ST1C_4@68
2226 int v59; // eax@68 2222 int v59; // eax@68
2227 int v60; // edi@69 2223 int v60; // edi@69
2228 signed int v61; // ebx@73 2224 signed int v61; // ebx@73
2229 Texture *v62; // eax@75 2225 Texture *v62; // eax@75
2230 int v63; // edi@76 2226 int v63; // edi@76
2231 Texture *v64; // ST1C_4@76 2227 Texture *v64; // ST1C_4@76
2232 unsigned int v65; // ST18_4@76 2228 unsigned int v65; // ST18_4@76
2233 int v66; // eax@76 2229 int v66; // eax@76
2234 int v67; // edi@77 2230 int v67; // edi@77
2235 signed int v68; // ecx@81 2231 signed int v68; // ecx@81
2236 SHORT v69; // bx@89 2232 SHORT v69; // bx@89
2237 bool v70; // eax@89 2233 bool v70; // eax@89
2238 const char *v71; // ecx@91 2234 const char *v71; // ecx@91
2239 void *v72; // eax@95 2235 void *v72; // eax@95
2240 POINT *v73; // esi@97 2236 POINT *v73; // esi@97
2241 int v74; // ecx@97 2237 int v74; // ecx@97
2242 int v75; // eax@98 2238 int v75; // eax@98
2243 int v76; // ecx@98 2239 int v76; // ecx@98
2244 ItemGen *v77; // ecx@99 2240 ItemGen *v77; // ecx@99
2245 unsigned __int8 v78; // bl@104 2241 unsigned __int8 v78; // bl@104
2246 char **v79; // edi@105 2242 char **v79; // edi@105
2247 int v80; // ebx@105 2243 int v80; // ebx@105
2248 char **v81; // esi@105 2244 char **v81; // esi@105
2249 int v82; // eax@106 2245 int v82; // eax@106
2250 GUIWindow *v83; // ecx@107 2246 GUIWindow *v83; // ecx@107
2251 int v84; // eax@107 2247 int v84; // eax@107
2252 int v85; // edx@107 2248 int v85; // edx@107
2253 int v86; // ebx@107 2249 int v86; // ebx@107
2254 GUIButton *v87; // eax@109 2250 GUIButton *v87; // eax@109
2255 GUIButton *v88; // esi@109 2251 GUIButton *v88; // esi@109
2256 int v89; // eax@109 2252 int v89; // eax@109
2257 unsigned int v90; // ecx@109 2253 unsigned int v90; // ecx@109
2258 int v91; // edx@109 2254 int v91; // edx@109
2259 unsigned __int16 v92; // ax@109 2255 unsigned __int16 v92; // ax@109
2260 signed int v93; // edx@114 2256 signed int v93; // edx@114
2261 POINT *v94; // edi@120 2257 POINT *v94; // edi@120
2262 __int32 v95; // ecx@120 2258 __int32 v95; // ecx@120
2263 void *v96; // ST14_4@122 2259 void *v96; // ST14_4@122
2264 unsigned __int8 v97; // bl@122 2260 unsigned __int8 v97; // bl@122
2265 ItemGen *v98; // ST10_4@122 2261 ItemGen *v98; // ST10_4@122
2266 int v99; // eax@122 2262 int v99; // eax@122
2267 char *v100; // eax@122 2263 char *v100; // eax@122
2268 const char *v101; // ST18_4@122 2264 const char *v101; // ST18_4@122
2269 unsigned __int16 v102; // ST14_2@122 2265 unsigned __int16 v102; // ST14_2@122
2270 int v103; // eax@122 2266 int v103; // eax@122
2271 signed int v104; // edi@123 2267 signed int v104; // edi@123
2272 Texture *v105; // eax@125 2268 Texture *v105; // eax@125
2273 int v106; // ebx@126 2269 int v106; // ebx@126
2274 Texture *v107; // ST1C_4@126 2270 Texture *v107; // ST1C_4@126
2275 unsigned int v108; // ST18_4@126 2271 unsigned int v108; // ST18_4@126
2276 int v109; // eax@126 2272 int v109; // eax@126
2277 int v110; // ebx@127 2273 int v110; // ebx@127
2278 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36 2274 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
2279 unsigned int v112; // [sp-14h] [bp-118h]@13 2275 unsigned int v112; // [sp-14h] [bp-118h]@13
2280 int v113; // [sp-14h] [bp-118h]@36 2276 int v113; // [sp-14h] [bp-118h]@36
2281 ItemGen *v114; // [sp-10h] [bp-114h]@12 2277 ItemGen *v114; // [sp-10h] [bp-114h]@12
2282 unsigned int v115; // [sp-10h] [bp-114h]@13 2278 unsigned int v115; // [sp-10h] [bp-114h]@13
2283 ItemGen *v116; // [sp-10h] [bp-114h]@20 2279 ItemGen *v116; // [sp-10h] [bp-114h]@20
2284 int v117; // [sp-10h] [bp-114h]@36 2280 int v117; // [sp-10h] [bp-114h]@36
2285 void *v118; // [sp-Ch] [bp-110h]@12 2281 void *v118; // [sp-Ch] [bp-110h]@12
2286 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13 2282 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
2287 void *v120; // [sp-Ch] [bp-110h]@20 2283 void *v120; // [sp-Ch] [bp-110h]@20
2288 char *v121; // [sp-8h] [bp-10Ch]@13 2284 char *v121; // [sp-8h] [bp-10Ch]@13
2289 int v122; // [sp-8h] [bp-10Ch]@20 2285 int v122; // [sp-8h] [bp-10Ch]@20
2290 unsigned int v123; // [sp-4h] [bp-108h]@13 2286 unsigned int v123; // [sp-4h] [bp-108h]@13
2291 __int64 *v124; // [sp-4h] [bp-108h]@20 2287 __int64 *v124; // [sp-4h] [bp-108h]@20
2292 int v125; // [sp-4h] [bp-108h]@68 2288 int v125; // [sp-4h] [bp-108h]@68
2293 int v126; // [sp-4h] [bp-108h]@76 2289 int v126; // [sp-4h] [bp-108h]@76
2294 int v127; // [sp-4h] [bp-108h]@126 2290 int v127; // [sp-4h] [bp-108h]@126
2295 POINT v128; // [sp+Ch] [bp-F8h]@8 2291 POINT v128; // [sp+Ch] [bp-F8h]@8
2296 POINT v129; // [sp+14h] [bp-F0h]@18 2292 POINT v129; // [sp+14h] [bp-F0h]@18
2297 char v130; // [sp+1Ch] [bp-E8h]@120 2293 char v130; // [sp+1Ch] [bp-E8h]@120
2298 POINT a2; // [sp+24h] [bp-E0h]@8 2294 POINT a2; // [sp+24h] [bp-E0h]@8
2299 POINT v132; // [sp+2Ch] [bp-D8h]@120 2295 POINT v132; // [sp+2Ch] [bp-D8h]@120
2300 POINT v133; // [sp+34h] [bp-D0h]@17 2296 POINT v133; // [sp+34h] [bp-D0h]@17
2301 char v134; // [sp+3Ch] [bp-C8h]@97 2297 POINT v134; // [sp+3Ch] [bp-C8h]@97
2302 POINT v135; // [sp+44h] [bp-C0h]@31 2298 POINT v135; // [sp+44h] [bp-C0h]@31
2303 POINT v136; // [sp+4Ch] [bp-B8h]@97 2299 POINT v136; // [sp+4Ch] [bp-B8h]@97
2304 POINT v137; // [sp+54h] [bp-B0h]@17 2300 POINT v137; // [sp+54h] [bp-B0h]@17
2305 POINT v138; // [sp+5Ch] [bp-A8h]@32 2301 POINT v138; // [sp+5Ch] [bp-A8h]@32
2306 POINT v139; // [sp+64h] [bp-A0h]@17 2302 POINT v139; // [sp+64h] [bp-A0h]@17
2307 POINT v140; // [sp+6Ch] [bp-98h]@31 2303 POINT v140; // [sp+6Ch] [bp-98h]@31
2308 POINT v141; // [sp+74h] [bp-90h]@8 2304 POINT v141; // [sp+74h] [bp-90h]@8
2309 POINT v142; // [sp+7Ch] [bp-88h]@31 2305 POINT v142; // [sp+7Ch] [bp-88h]@31
2310 POINT v143; // [sp+84h] [bp-80h]@9 2306 POINT v143; // [sp+84h] [bp-80h]@9
2311 GUIWindow v144; // [sp+8Ch] [bp-78h]@1 2307 GUIWindow v144; // [sp+8Ch] [bp-78h]@1
2312 char *Str; // [sp+E0h] [bp-24h]@56 2308 char *Str; // [sp+E0h] [bp-24h]@56
2313 int v146; // [sp+E4h] [bp-20h]@24 2309 int v146; // [sp+E4h] [bp-20h]@24
2314 int v147; // [sp+E8h] [bp-1Ch]@1 2310 int v147; // [sp+E8h] [bp-1Ch]@1
2315 int v148; // [sp+ECh] [bp-18h]@1 2311 int v148; // [sp+ECh] [bp-18h]@1
2316 __int32 v149; // [sp+F0h] [bp-14h]@8 2312 __int32 v149; // [sp+F0h] [bp-14h]@8
2317 Player *_this; // [sp+F4h] [bp-10h]@1 2313 Player* _this; // [sp+F4h] [bp-10h]@1
2318 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15 2314 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
2319 int v152; // [sp+FCh] [bp-8h]@24 2315 int v152; // [sp+FCh] [bp-8h]@24
2320 int v153; // [sp+100h] [bp-4h]@44 2316 int v153; // [sp+100h] [bp-4h]@44
2321 2317 int th;
2322 v0 = pPlayers[uActiveCharacter]; 2318
2323 _this = pPlayers[uActiveCharacter]; 2319 v0 = pPlayers[uActiveCharacter];
2324 memcpy(&v144, window_SpeakInHouse, sizeof(v144)); 2320 _this = pPlayers[uActiveCharacter];
2325 v144.uFrameX = 483; 2321 memcpy(&v144, window_SpeakInHouse, sizeof(v144));
2326 v144.uFrameWidth = 148; 2322 v144.uFrameX = 483;
2327 v144.uFrameZ = 334; 2323 v144.uFrameWidth = 148;
2328 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 2324 v144.uFrameZ = 334;
2329 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 2325 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
2330 if ( dword_F8B19C > 5 ) 2326 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
2331 { 2327 switch (dword_F8B19C)
2332 if ( dword_F8B19C == 6 ) 2328 {
2333 { 2329 case 1: //prepare shop text
2334 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); 2330 {
2335 sub_4B46A5(pGlobalTXT_LocalizationStrings[195], 0); 2331 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2336 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2332 {
2337 return; 2333 v16 = pShopOptions;
2338 v149 = 0; 2334 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
2339 v93 = 0; 2335 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
2340 do 2336 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
2341 { 2337 v17 = 0;
2342 // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2338 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
2343 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID) 2339 for(int i=0;i<4;++i)
2344 ++v149; 2340 {
2345 ++v93; 2341 v19 = pFontArrus->CalcTextHeight(pShopOptions[i], &v144, 0, 0);
2346 } 2342 v17 += v19;
2347 while ( v93 < 8 ); 2343 }
2348 if ( v149 ) 2344 v20 = pDialogueWindow;
2349 { 2345 v146 = (174 - v17) / 4;
2350 v94 = pMouse->GetCursorPos(&v132); 2346 v21 = pDialogueWindow->pStartingPosActiveItem;
2351 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]]; 2347 v22 = v21 + pDialogueWindow->pNumPresenceButton;
2352 v95 = v149; 2348 v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
2353 if ( v149 && v149 != -65536 ) 2349 v24 = -pDialogueWindow->pNumPresenceButton < 0;
2354 { 2350 v152 = pDialogueWindow->pStartingPosActiveItem;
2355 --v149; 2351 if ( v24 ^ __OFSUB__(v21, v22) )
2356 v96 = window_SpeakInHouse->ptr_1C; 2352 {
2357 v97 = uActiveCharacter - 1; 2353 th = 2;
2358 // v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724]; 2354 do
2359 v99 = _this->_490EEE( 2355 {
2360 &pParty->SpecialItemsInShops[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724], 2356 v25 = v20->GetControl(v152);
2361 2, 2357 v26 = v25;
2362 (int)window_SpeakInHouse->ptr_1C, 2358 v25->uY = v146 + v23;
2363 2); 2359 v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
2364 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0); 2360 v28 = v26->uY;
2365 v101 = v100; 2361 v29 = _this;
2366 v102 = v148; 2362 v26->uHeight = v27;
2367 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0); 2363 v23 = v28 + v27 - 1;
2368 v144.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u); 2364 v26->uW = v23;
2369 } 2365 v30 = v147;
2370 v104 = 0; 2366 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 )
2371 v153 = 0; 2367 v30 = v148;
2372 do 2368 v144.DrawTitleText(pFontArrus, 0, v28, v30, *v16, 3u);
2373 { 2369 v20 = pDialogueWindow;
2374 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2370 ++th;
2375 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID) 2371 ++v16;
2376 { 2372 ++v152;
2377 v105 = dword_F8B168[v104]; 2373 }
2378 if ( v104 >= 4 ) 2374 while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
2379 { 2375 }
2380 v110 = 90 - ((signed int)v105->uTextureWidth >> 1); 2376 }
2381 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, dword_F8B168[v104]); 2377 }
2382 v127 = v104 + 1; 2378 break;
2383 v109 = v153 + v110 + 80220; 2379 case 2: //buy standart
2384 } 2380 {
2385 else 2381 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
2386 { 2382 v55 = 0;
2387 v106 = 98 - v105->uTextureHeight; 2383 v153 = 0;
2388 v107 = dword_F8B168[v104]; 2384 for(int i=0; i<8; ++i)
2389 v108 = 98 - v105->uTextureHeight; 2385 {
2390 v152 = 86 - ((signed int)v105->uTextureWidth >> 1); 2386 // if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
2391 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107); 2387 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID);
2392 v127 = v104 + 1; 2388 {
2393 v109 = v152 + v153 + 640 * v106; 2389 v56 = ItemsInShopTexture[v55];
2394 } 2390 if ( i >= 4 )
2395 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], dword_F8B168[v104], v127); 2391 {
2396 } 2392 v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
2397 v153 += 105; 2393 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
2398 ++v104; 2394 v59 = v60 + v153 + 80220;
2399 } 2395 }
2400 while ( v104 < 8 ); 2396 else
2401 return; 2397 {
2402 } 2398 v57 = 98 - v56->uTextureHeight;
2403 v72 = window_SpeakInHouse->ptr_1C; 2399 v58 = ItemsInShopTexture[i];
2404 goto LABEL_96; 2400 v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
2405 } 2401 pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
2406 if ( dword_F8B19C == 94 ) 2402 v59 = v153 + v152 + 640 * v57;
2407 { 2403 }
2408 draw_leather(); 2404 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i+1);
2409 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 2405 }
2410 v79 = pShopOptions; 2406 v153 += 105;
2411 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; 2407
2412 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; 2408 }
2413 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; 2409
2414 v80 = 0; 2410 v11 = 0;
2415 v81 = pShopOptions; 2411 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2416 do 2412 return;
2417 { 2413
2418 v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0); 2414 v149 = 0;
2419 ++v81; 2415 for(int i=0; i<6; ++i)
2420 v80 += v82; 2416 {
2421 } 2417 // if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 )
2422 while ( (signed int)v81 < (signed int)&pShopOptions[3] ); 2418 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID);
2423 v83 = pDialogueWindow; 2419 ++v149;
2424 v152 = (174 - v80) / 3; 2420
2425 v84 = pDialogueWindow->pStartingPosActiveItem; 2421 }
2426 v85 = v84 + pDialogueWindow->pNumPresenceButton; 2422
2427 v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138; 2423 v69 = GetAsyncKeyState(17);
2428 v24 = -pDialogueWindow->pNumPresenceButton < 0; 2424 v70 = _this->CanSteal();
2429 _this = (Player *)pDialogueWindow->pStartingPosActiveItem; 2425 //Str = (char *)v70;
2430 if ( v24 ^ __OFSUB__(v84, v85) ) 2426 if ( v69 == 0 || v70 == 0 )
2431 { 2427 {
2432 v153 = 2; 2428 v71 = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
2433 do 2429 }
2434 { 2430 else
2435 v87 = v83->GetControl((unsigned int)_this); 2431 {
2436 v88 = v87; 2432 v71 = pGlobalTXT_LocalizationStrings[185];//"Steal item"
2437 v87->uY = v152 + v86; 2433 }
2438 v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0); 2434 DrawTextAtStatusBar(v71, 0);
2439 v90 = v88->uY; 2435 if ( v149 != 0 )
2440 v91 = v153; 2436 {
2441 v88->uHeight = v89; 2437 v73 = pMouse->GetCursorPos(&v136);
2442 v86 = v90 + v89 - 1; 2438 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
2443 v88->uW = v86; 2439 if ( !v74 )
2444 v92 = v147; 2440 return;
2445 if ( pDialogueWindow->pCurrentPosActiveItem != v91 ) 2441 v149 = v74 - 1;
2446 v92 = v148; 2442 v75 = (int)window_SpeakInHouse->ptr_1C;
2447 v144.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u); 2443 v77 = &pParty->StandartItemsInShops[(int)v75][v74-1];
2448 v83 = pDialogueWindow; 2444 if ( v69 ==0 || v70 == 0)
2449 ++v153; 2445 {
2450 ++v79; 2446 v120 = window_SpeakInHouse->ptr_1C;
2451 _this = (Player *)((char *)_this + 1); 2447 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
2452 } 2448 }
2453 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); 2449 else
2454 } 2450 {
2455 return; 2451 v120 = window_SpeakInHouse->ptr_1C;
2456 } 2452 v15 = pGlobalTXT_LocalizationStrings[181];
2457 if ( dword_F8B19C != 95 ) 2453 }
2458 { 2454 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v77, (char *)v120, 2, 0);
2459 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2455 v115 = (174 - pFontArrus->CalcTextHeight(v36, &v144, 0, 0)) / 2 + 138;
2460 return; 2456 v144.DrawTitleText(pFontArrus, 0, v115, v148, v36, 3);
2461 v152 = 0; 2457 return;
2462 v37 = pDialogueWindow; 2458 }
2463 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); 2459 v72 = window_SpeakInHouse->ptr_1C;
2464 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); 2460 v144.DrawCurrentTime( pParty->field_3C.field_50[(int)v72]- pParty->uTimePlayed);
2465 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100); 2461 return;
2466 if ( (signed int)_this < v38 / 3 ) 2462 }
2467 _this = (Player *)(v38 / 3); 2463 break;
2468 v39 = v37->pStartingPosActiveItem; 2464 case 3:
2469 v40 = v37->pNumPresenceButton; 2465 {
2470 v153 = 0; 2466 draw_leather();
2471 if ( (signed int)v39 < (signed int)(v39 + v40) ) 2467 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
2472 { 2468 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
2473 do 2469 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
2474 { 2470 || (v9 = pMouse->GetCursorPos(&v139)->x - 14,
2475 v41 = v37->GetControl(v39)->uControlParam - 36; 2471 v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
2476 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v41] && !v0->pActiveSkills[v41] ) 2472 pMouse->GetCursorPos(&v137)->x <= 13)
2477 { 2473 || pMouse->GetCursorPos(&v129)->x >= 462
2478 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0); 2474 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
2479 v152 += v42; 2475 return;
2480 ++v153; 2476 v124 = 0;
2481 } 2477 v122 = 3;
2482 ++v39; 2478 v120 = window_SpeakInHouse->ptr_1C;
2483 } 2479 v116 = (ItemGen *)&v0->pInventoryItems[v10-1];
2484 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem ); 2480 v12 = (int)window_SpeakInHouse->ptr_1C;
2485 if ( v153 ) 2481 uPlayerID = uActiveCharacter - 1;
2486 { 2482 v13 = v0->_490EEE(v116, 2, v12, 3);
2487 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this); 2483 v14 = uPlayerID;
2488 v144.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); 2484 v15 = (char *)pMerchantsSellPhrases[v13];
2489 _this = (Player *)((149 - v152) / v153); 2485 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
2490 if ( (149 - v152) / v153 > 32 ) 2486 v123 = 3;
2491 _this = (Player *)32; 2487 v121 = v36;
2492 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162; 2488 v119 = v148;
2493 v152 = v37->pStartingPosActiveItem; 2489 v117 = (int)v11;
2494 v146 = v43; 2490 v113 = (int)v11;
2495 if ( v152 < v152 + v37->pNumPresenceButton ) 2491 v111 = &v144;
2496 { 2492 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
2497 v153 = 2; 2493 v112 = (unsigned int)v11;
2498 do 2494 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
2499 { 2495 return;
2500 v44 = v37->GetControl(v152); 2496 }
2501 v45 = v44; 2497 break;
2502 v46 = v44->uControlParam - 36; 2498 case 4:
2503 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v46] || v0->pActiveSkills[v46] ) 2499 {
2504 { 2500 draw_leather();
2505 v45->uW = 0; 2501 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
2506 v45->uHeight = 0; 2502 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
2507 v45->uY = 0; 2503 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2508 } 2504 {
2509 else 2505 v1 = pMouse->GetCursorPos(&a2)->x - 14;
2510 { 2506 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
2511 v47 = pSkillNames[v46]; 2507 if ( pMouse->GetCursorPos(&v141)->x > 13 )
2512 v45->uY = (unsigned int)((char *)_this + v146); 2508 {
2513 Str = v47; 2509 if ( pMouse->GetCursorPos(&v143)->x < 462 )
2514 v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0); 2510 {
2515 v49 = v45->uY; 2511 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
2516 v50 = v153; 2512 if ( v2 )
2517 v45->uHeight = v48; 2513 {
2518 v51 = v49 + v48 - 1; 2514 v3 = (ItemGen *)&v0->pInventoryItems[v2-1];
2519 v45->uW = v51; 2515 if (v3->Identified())
2520 v146 = v51; 2516 {
2521 v52 = v147; 2517 v118 = window_SpeakInHouse->ptr_1C;
2522 if ( pDialogueWindow->pCurrentPosActiveItem != v50 ) 2518 v4 = uActiveCharacter - 1;
2523 v52 = v148; 2519 v5 = "%24";
2524 v144.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u); 2520 v114 = v3;
2525 } 2521 }
2526 v53 = v37->pStartingPosActiveItem; 2522 else
2527 ++v152; 2523 {
2528 v54 = v37->pNumPresenceButton + v53; 2524 v118 = window_SpeakInHouse->ptr_1C;
2529 ++v153; 2525 v114 = v3;
2530 } 2526 v7 = (int)window_SpeakInHouse->ptr_1C;
2531 while ( v152 < v54 ); 2527 uPlayerID = uActiveCharacter - 1;
2532 } 2528 v8 = v0->_490EEE(v3, 2, v7, 4);
2533 return; 2529 v4 = uPlayerID;
2534 } 2530 v5 = (char *)pMerchantsIdentifyPhrases[v8];
2535 } 2531 }
2536 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]); 2532 v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0);
2537 strcat(pTmpBuf, "\n \n"); 2533 v123 = 3;
2538 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 2534 v121 = v6;
2539 v11 = 0; 2535 v119 = v148;
2540 v36 = pTmpBuf; 2536 v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
2541 v123 = 3; 2537 v112 = 0;
2542 v121 = pTmpBuf; 2538 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
2543 v119 = v147; 2539 return;
2544 v117 = 0; 2540 }
2545 v113 = 0; 2541 }
2546 v111 = &v144; 2542 }
2547 LABEL_63: 2543 }
2548 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138; 2544 }
2549 v112 = (unsigned int)v11; 2545 break;
2550 LABEL_14: 2546 case 5:
2551 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123); 2547 {
2552 return; 2548 draw_leather();
2553 } 2549 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
2554 LABEL_64: 2550 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
2555 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); 2551 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
2556 if ( dword_F8B19C == 2 ) 2552 || (v31 = pMouse->GetCursorPos(&v135)->x - 14,
2557 { 2553 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
2558 v55 = 0; 2554 pMouse->GetCursorPos(&v140)->x <= 13)
2559 v153 = 0; 2555 || pMouse->GetCursorPos(&v138)->x >= 462
2560 do 2556 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
2561 { 2557 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
2562 // if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 2558 return;
2563 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID); 2559 v124 = 0;
2564 { 2560 v122 = 5;
2565 v56 = dword_F8B168[v55]; 2561 v120 = window_SpeakInHouse->ptr_1C;
2566 if ( v55 >= 4 ) 2562 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
2567 { 2563 v34 = (int)window_SpeakInHouse->ptr_1C;
2568 v60 = 90 - ((signed int)v56->uTextureWidth >> 1); 2564 uPlayerID = uActiveCharacter - 1;
2569 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 0x7Eu, dword_F8B168[v55]); 2565 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
2570 v125 = v55 + 1; 2566 v14 = uPlayerID;
2571 v59 = v60 + v153 + 80220; 2567 v15 = (char *)pMerchantsRepairPhrases[v35];
2572 } 2568 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
2573 else 2569 v123 = 3;
2574 { 2570 v121 = v36;
2575 v57 = 98 - v56->uTextureHeight; 2571 v119 = v148;
2576 v58 = dword_F8B168[v55]; 2572 v117 = (int)v11;
2577 v152 = 86 - ((signed int)v56->uTextureWidth >> 1); 2573 v113 = (int)v11;
2578 pRenderer->DrawTextureTransparent(v153 + v152, v57, v58); 2574 v111 = &v144;
2579 v125 = v55 + 1; 2575 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
2580 v59 = v153 + v152 + 640 * v57; 2576 v112 = (unsigned int)v11;
2581 } 2577 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
2582 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], dword_F8B168[v55], v125); 2578 return;
2583 } 2579 }
2584 v153 += 105; 2580 break;
2585 ++v55; 2581 case 6:
2586 } 2582 {
2587 while ( v55 < 8 ); 2583 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
2588 v11 = 0; 2584 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0);
2589 } 2585 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2590 else 2586 return;
2591 { 2587 v149 = 0;
2592 v11 = 0; 2588 v93 = 0;
2593 v61 = 0; 2589 do
2594 v153 = 0; 2590 {
2595 do 2591 // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2596 { 2592 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID)
2597 // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) 2593 ++v149;
2598 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID) 2594 ++v93;
2599 { 2595 }
2600 v62 = dword_F8B168[v61]; 2596 while ( v93 < 8 );
2601 if ( v61 >= 4 ) 2597 if ( v149 )
2602 { 2598 {
2603 v67 = 90 - ((signed int)v62->uTextureWidth >> 1); 2599 v94 = pMouse->GetCursorPos(&v132);
2604 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, dword_F8B168[v61]); 2600 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
2605 v126 = v61 + 1; 2601 v95 = v149;
2606 v66 = v153 + v67 + 80220; 2602 if ( v149 && v149 != -65536 )
2607 } 2603 {
2608 else 2604 --v149;
2609 { 2605 v96 = window_SpeakInHouse->ptr_1C;
2610 v63 = 98 - v62->uTextureHeight; 2606 v97 = uActiveCharacter - 1;
2611 v64 = dword_F8B168[v61]; 2607 // v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
2612 v65 = 98 - v62->uTextureHeight; 2608 v99 = _this->_490EEE(
2613 v152 = 86 - ((signed int)v62->uTextureWidth >> 1); 2609 &pParty->SpecialItemsInShops[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
2614 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64); 2610 2,
2615 v126 = v61 + 1; 2611 (int)window_SpeakInHouse->ptr_1C,
2616 v66 = v152 + v153 + 640 * v63; 2612 2);
2617 } 2613 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
2618 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], dword_F8B168[v61], v126); 2614 v101 = v100;
2619 v11 = 0; 2615 v102 = v148;
2620 } 2616 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
2621 v153 += 105; 2617 v144.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
2622 ++v61; 2618 }
2623 } 2619 v104 = 0;
2624 while ( v61 < 8 ); 2620 v153 = 0;
2625 } 2621 do
2626 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2622 {
2627 return; 2623 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2628 v68 = 0; 2624 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID)
2629 v149 = (__int32)v11; 2625 {
2630 if ( dword_F8B19C == 2 ) 2626 v105 = ItemsInShopTexture[v104];
2631 { 2627 if ( v104 >= 4 )
2632 do 2628 {
2633 { 2629 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
2634 // if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 ) 2630 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
2635 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v68].uItemID); 2631 v127 = v104 + 1;
2636 ++v149; 2632 v109 = v153 + v110 + 80220;
2637 ++v68; 2633 }
2638 } 2634 else
2639 while ( v68 < 6 ); 2635 {
2640 } 2636 v106 = 98 - v105->uTextureHeight;
2641 else 2637 v107 = ItemsInShopTexture[v104];
2642 { 2638 v108 = 98 - v105->uTextureHeight;
2643 do 2639 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
2644 { 2640 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
2645 // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) 2641 v127 = v104 + 1;
2646 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID) 2642 v109 = v152 + v153 + 640 * v106;
2647 ++v149; 2643 }
2648 ++v68; 2644 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
2649 } 2645 }
2650 while ( v68 < 6 ); 2646 v153 += 105;
2651 } 2647 ++v104;
2652 v69 = GetAsyncKeyState(17); 2648 }
2653 v70 = _this->CanSteal(); 2649 while ( v104 < 8 );
2654 Str = (char *)v70; 2650 return;
2655 if ( v69 == (short)v11 || (char *)v70 == v11 ) 2651 }
2656 { 2652 v72 = window_SpeakInHouse->ptr_1C;
2657 v71 = pGlobalTXT_LocalizationStrings[195]; 2653 v144.DrawCurrentTime(pParty->field_3C.field_50[(int)v72]- pParty->uTimePlayed);
2658 if ( dword_F8B19C != 2 ) 2654 return;
2659 v71 = pGlobalTXT_LocalizationStrings[196]; 2655 }
2660 } 2656 break;
2661 else 2657 case 94:
2662 { 2658 {
2663 v71 = pGlobalTXT_LocalizationStrings[185]; 2659 draw_leather();
2664 } 2660 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
2665 sub_4B46A5(v71, 0); 2661 v79 = pShopOptions;
2666 if ( (char *)v149 != v11 ) 2662 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
2667 { 2663 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
2668 v73 = pMouse->GetCursorPos(&v136); 2664 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
2669 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF; 2665 v80 = 0;
2670 if ( !v74 ) 2666 v81 = pShopOptions;
2671 return; 2667 do
2672 v149 = v74 - 1; 2668 {
2673 v75 = (int)window_SpeakInHouse->ptr_1C; 2669 v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
2674 v76 = 9 * (v74 - 1 + 12 * v75); 2670 ++v81;
2675 if ( dword_F8B19C == 2 ) 2671 v80 += v82;
2676 v77 = (ItemGen *)&pParty->StandartItemsInShops[v76]; 2672 }
2677 else 2673 while ( (signed int)v81 < (signed int)&pShopOptions[3] );
2678 v77 = &pParty->SpecialItemsInShops[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724]; 2674 v83 = pDialogueWindow;
2679 if ( v69 == (short)v11 || Str == v11 ) 2675 v152 = (174 - v80) / 3;
2680 { 2676 v84 = pDialogueWindow->pStartingPosActiveItem;
2681 v124 = (__int64 *)v11; 2677 v85 = v84 + pDialogueWindow->pNumPresenceButton;
2682 v122 = 2; 2678 v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
2683 v120 = window_SpeakInHouse->ptr_1C; 2679 v24 = -pDialogueWindow->pNumPresenceButton < 0;
2684 v116 = v77; 2680 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
2685 v78 = uActiveCharacter - 1; 2681 if ( v24 ^ __OFSUB__(v84, v85) )
2686 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)]; 2682 {
2687 v14 = v78; 2683 v153 = 2;
2688 } 2684 do
2689 else 2685 {
2690 { 2686 v87 = v83->GetControl((unsigned int)_this);
2691 v124 = (__int64 *)v11; 2687 v88 = v87;
2692 v122 = 2; 2688 v87->uY = v152 + v86;
2693 v120 = window_SpeakInHouse->ptr_1C; 2689 v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
2694 v116 = v77; 2690 v90 = v88->uY;
2695 v15 = pGlobalTXT_LocalizationStrings[181]; 2691 v91 = v153;
2696 v14 = uActiveCharacter - 1; 2692 v88->uHeight = v89;
2697 } 2693 v86 = v90 + v89 - 1;
2698 LABEL_36: 2694 v88->uW = v86;
2699 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124); 2695 v92 = v147;
2700 v123 = 3; 2696 if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
2701 v121 = v36; 2697 v92 = v148;
2702 v119 = v148; 2698 v144.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u);
2703 v117 = (int)v11; 2699 v83 = pDialogueWindow;
2704 v113 = (int)v11; 2700 ++v153;
2705 v111 = &v144; 2701 ++v79;
2706 goto LABEL_63; 2702 _this = (Player *)((char *)_this + 1);
2707 } 2703 }
2708 v72 = window_SpeakInHouse->ptr_1C; 2704 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
2709 LABEL_96: 2705 }
2710 v144._4B1854( 2706 return;
2711 __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72]) 2707 }
2712 - pParty->uTimePlayed); 2708 break;
2713 return; 2709 case 95: //buy spesial
2714 } 2710 {
2715 if ( dword_F8B19C == 5 ) 2711
2716 { 2712 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
2717 draw_leather(); 2713
2718 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 2714 v11 = 0;
2719 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0); 2715 v61 = 0;
2720 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() 2716 v153 = 0;
2721 || (v31 = pMouse->GetCursorPos(&v135)->x - 14, 2717 do
2722 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5), 2718 {
2723 pMouse->GetCursorPos(&v140)->x <= 13) 2719 // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
2724 || pMouse->GetCursorPos(&v138)->x >= 462 2720 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID)
2725 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32) 2721 {
2726 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) ) 2722 v62 = ItemsInShopTexture[v61];
2727 return; 2723 if ( v61 >= 4 )
2728 v124 = 0; 2724 {
2729 v122 = 5; 2725 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
2730 v120 = window_SpeakInHouse->ptr_1C; 2726 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
2731 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5]; 2727 v126 = v61 + 1;
2732 v34 = (int)window_SpeakInHouse->ptr_1C; 2728 v66 = v153 + v67 + 80220;
2733 uPlayerID = uActiveCharacter - 1; 2729 }
2734 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5); 2730 else
2735 v14 = uPlayerID; 2731 {
2736 v15 = (char *)pMerchantsRepairPhrases[v35]; 2732 v63 = 98 - v62->uTextureHeight;
2737 goto LABEL_36; 2733 v64 = ItemsInShopTexture[v61];
2738 } 2734 v65 = 98 - v62->uTextureHeight;
2739 if ( dword_F8B19C == 1 ) 2735 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
2740 { 2736 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
2741 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2737 v126 = v61 + 1;
2742 { 2738 v66 = v152 + v153 + 640 * v63;
2743 v16 = pShopOptions; 2739 }
2744 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; 2740 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v126);
2745 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; 2741 v11 = 0;
2746 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; 2742 }
2747 v17 = 0; 2743 v153 += 105;
2748 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; 2744 ++v61;
2749 v18 = pShopOptions; 2745 }
2750 do 2746 while ( v61 < 8 );
2751 { 2747
2752 v19 = pFontArrus->CalcTextHeight(*v18, &v144, 0, 0); 2748 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2753 ++v18; 2749 return;
2754 v17 += v19; 2750 v68 = 0;
2755 } 2751 v149 = (__int32)v11;
2756 while ( (signed int)v18 < (signed int)&unk_F8B1C8 ); 2752
2757 v20 = pDialogueWindow; 2753 do
2758 v146 = (174 - v17) / 4; 2754 {
2759 v21 = pDialogueWindow->pStartingPosActiveItem; 2755 // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
2760 v22 = v21 + pDialogueWindow->pNumPresenceButton; 2756 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID)
2761 v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138; 2757 ++v149;
2762 v24 = -pDialogueWindow->pNumPresenceButton < 0; 2758 ++v68;
2763 v152 = pDialogueWindow->pStartingPosActiveItem; 2759 }
2764 if ( v24 ^ __OFSUB__(v21, v22) ) 2760 while ( v68 < 6 );
2765 { 2761
2766 _this = (Player *)2; 2762 v69 = GetAsyncKeyState(17);
2767 do 2763 v70 = _this->CanSteal();
2768 { 2764 Str = (char *)v70;
2769 v25 = v20->GetControl(v152); 2765 if ( v69 == (short)v11 || (char *)v70 == v11 )
2770 v26 = v25; 2766 {
2771 v25->uY = v146 + v23; 2767 v71 = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
2772 v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0); 2768 }
2773 v28 = v26->uY; 2769 else
2774 v29 = _this; 2770 {
2775 v26->uHeight = v27; 2771 v71 = pGlobalTXT_LocalizationStrings[185];
2776 v23 = v28 + v27 - 1; 2772 }
2777 v26->uW = v23; 2773 DrawTextAtStatusBar(v71, 0);
2778 v30 = v147; 2774 if ( (char *)v149 != v11 )
2779 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 ) 2775 {
2780 v30 = v148; 2776 v73 = pMouse->GetCursorPos(&v136);
2781 v144.DrawTitleText(pFontArrus, 0, v28, v30, *v16, 3u); 2777 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
2782 v20 = pDialogueWindow; 2778 if ( !v74 )
2783 _this = (Player *)((char *)_this + 1); 2779 return;
2784 ++v16; 2780 v149 = v74 - 1;
2785 ++v152; 2781 v75 = (int)window_SpeakInHouse->ptr_1C;
2786 } 2782 v76 = 9 * (v74 - 1 + 12 * v75);
2787 while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); 2783 if ( dword_F8B19C == 2 )
2788 } 2784 v77 = (ItemGen *)&pParty->StandartItemsInShops[v76];
2789 } 2785 else
2790 return; 2786 v77 = &pParty->SpecialItemsInShops[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
2791 } 2787 if ( v69 == (short)v11 || Str == v11 )
2792 if ( dword_F8B19C == 2 ) 2788 {
2793 goto LABEL_64; 2789 v124 = (__int64 *)v11;
2794 if ( dword_F8B19C == 3 ) 2790 v122 = 2;
2795 { 2791 v120 = window_SpeakInHouse->ptr_1C;
2796 draw_leather(); 2792 v116 = v77;
2797 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 2793 v78 = uActiveCharacter - 1;
2798 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0); 2794 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
2799 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() 2795 v14 = v78;
2800 || (v9 = pMouse->GetCursorPos(&v139)->x - 14, 2796 }
2801 v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), 2797 else
2802 pMouse->GetCursorPos(&v137)->x <= 13) 2798 {
2803 || pMouse->GetCursorPos(&v129)->x >= 462 2799 v124 = (__int64 *)v11;
2804 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) ) 2800 v122 = 2;
2805 return; 2801 v120 = window_SpeakInHouse->ptr_1C;
2806 v124 = 0; 2802 v116 = v77;
2807 v122 = 3; 2803 v15 = pGlobalTXT_LocalizationStrings[181];
2808 v120 = window_SpeakInHouse->ptr_1C; 2804 v14 = uActiveCharacter - 1;
2809 v116 = (ItemGen *)&v0->pInventoryItems[v10-1]; 2805 }
2810 v12 = (int)window_SpeakInHouse->ptr_1C; 2806 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
2811 uPlayerID = uActiveCharacter - 1; 2807 v123 = 3;
2812 v13 = v0->_490EEE(v116, 2, v12, 3); 2808 v121 = v36;
2813 v14 = uPlayerID; 2809 v119 = v148;
2814 v15 = (char *)pMerchantsSellPhrases[v13]; 2810 v117 = (int)v11;
2815 goto LABEL_36; 2811 v113 = (int)v11;
2816 } 2812 v111 = &v144;
2817 if ( dword_F8B19C == 4 ) 2813 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
2818 { 2814 v112 = (unsigned int)v11;
2819 draw_leather(); 2815 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
2820 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 2816 return;
2821 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0); 2817 }
2822 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) 2818 v72 = window_SpeakInHouse->ptr_1C;
2823 { 2819 v144.DrawCurrentTime( pParty->field_3C.field_50[(int)v72]- pParty->uTimePlayed);
2824 v1 = pMouse->GetCursorPos(&a2)->x - 14; 2820 return;
2825 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5); 2821 }
2826 if ( pMouse->GetCursorPos(&v141)->x > 13 ) 2822
2827 { 2823 break;
2828 if ( pMouse->GetCursorPos(&v143)->x < 462 ) 2824 case 96:
2829 { 2825 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
2830 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149); 2826 return;
2831 if ( v2 ) 2827 v152 = 0;
2832 { 2828 v37 = pDialogueWindow;
2833 v3 = (ItemGen *)&v0->pInventoryItems[v2-1]; 2829 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
2834 if (v3->Identified()) 2830 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
2835 { 2831 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
2836 v118 = window_SpeakInHouse->ptr_1C; 2832 if ( (signed int)_this < v38 / 3 )
2837 v4 = uActiveCharacter - 1; 2833 _this = (Player *)(v38 / 3);
2838 v5 = "%24"; 2834 v39 = v37->pStartingPosActiveItem;
2839 v114 = v3; 2835 v40 = v37->pNumPresenceButton;
2840 } 2836 v153 = 0;
2841 else 2837 if ( (signed int)v39 < (signed int)(v39 + v40) )
2842 { 2838 {
2843 v118 = window_SpeakInHouse->ptr_1C; 2839 do
2844 v114 = v3; 2840 {
2845 v7 = (int)window_SpeakInHouse->ptr_1C; 2841 v41 = v37->GetControl(v39)->uControlParam - 36;
2846 uPlayerID = uActiveCharacter - 1; 2842 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v41] && !v0->pActiveSkills[v41] )
2847 v8 = v0->_490EEE(v3, 2, v7, 4); 2843 {
2848 v4 = uPlayerID; 2844 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
2849 v5 = (char *)pMerchantsIdentifyPhrases[v8]; 2845 v152 += v42;
2850 } 2846 ++v153;
2851 v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0); 2847 }
2852 v123 = 3; 2848 ++v39;
2853 v121 = v6; 2849 }
2854 v119 = v148; 2850 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
2855 v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138; 2851 if ( v153 )
2856 v112 = 0; 2852 {
2857 goto LABEL_14; 2853 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
2858 } 2854 v144.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
2859 } 2855 _this = (Player *)((149 - v152) / v153);
2860 } 2856 if ( (149 - v152) / v153 > 32 )
2861 } 2857 _this = (Player *)32;
2862 } 2858 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
2863 } 2859 v152 = v37->pStartingPosActiveItem;
2860 v146 = v43;
2861 if ( v152 < v152 + v37->pNumPresenceButton )
2862 {
2863 v153 = 2;
2864 do
2865 {
2866 v44 = v37->GetControl(v152);
2867 v45 = v44;
2868 v46 = v44->uControlParam - 36;
2869 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v46] || v0->pActiveSkills[v46] )
2870 {
2871 v45->uW = 0;
2872 v45->uHeight = 0;
2873 v45->uY = 0;
2874 }
2875 else
2876 {
2877 v47 = pSkillNames[v46];
2878 v45->uY = (unsigned int)((char *)_this + v146);
2879 Str = v47;
2880 v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
2881 v49 = v45->uY;
2882 v50 = v153;
2883 v45->uHeight = v48;
2884 v51 = v49 + v48 - 1;
2885 v45->uW = v51;
2886 v146 = v51;
2887 v52 = v147;
2888 if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
2889 v52 = v148;
2890 v144.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u);
2891 }
2892 v53 = v37->pStartingPosActiveItem;
2893 ++v152;
2894 v54 = v37->pNumPresenceButton + v53;
2895 ++v153;
2896 }
2897 while ( v152 < v54 );
2898 }
2899 return;
2900 }
2901 }
2902 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);
2903 strcat(pTmpBuf, "\n \n");
2904 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
2905 v11 = 0;
2906 v36 = pTmpBuf;
2907 v123 = 3;
2908 v121 = pTmpBuf;
2909 v119 = v147;
2910 v117 = 0;
2911 v113 = 0;
2912 v111 = &v144;
2913 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
2914 v112 = (unsigned int)v11;
2915 v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
2916 return;
2917 break;
2918
2919 }
2920
2921 }
2864 2922
2865 //----- (004BB756) -------------------------------------------------------- 2923 //----- (004BB756) --------------------------------------------------------
2866 signed int __fastcall sub_4BB756(signed int a1) 2924 signed int __fastcall sub_4BB756(signed int a1)
2867 { 2925 {
2868 unsigned int v1; // esi@8 2926 unsigned int v1; // esi@8
3784 { 3842 {
3785 v34 = pIcons_LOD->LoadTexture( 3843 v34 = pIcons_LOD->LoadTexture(
3786 pItemsTable->pItems[v33].pIconName, 3844 pItemsTable->pItems[v33].pIconName,
3787 TEXTURE_16BIT_PALETTE); 3845 TEXTURE_16BIT_PALETTE);
3788 v8 = window_SpeakInHouse; 3846 v8 = window_SpeakInHouse;
3789 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34]; 3847 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
3790 } 3848 }
3791 ++v32; 3849 ++v32;
3792 } 3850 }
3793 while ( v32 < 12 ); 3851 while ( v32 < 12 );
3794 } 3852 }
4124 } 4182 }
4125 } 4183 }
4126 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 4184 sub_421B2C_PlaceInInventory_or_DropPickedItem();
4127 return; 4185 return;
4128 } 4186 }
4129 if ( (signed __int64)__PAIR__( 4187 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
4130 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
4131 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
4132 { 4188 {
4133 GenerateStandartShopItems(); 4189 GenerateStandartShopItems();
4134 GenerateSpecialShopItems(); 4190 GenerateSpecialShopItems();
4135 v8 = window_SpeakInHouse; 4191 v8 = window_SpeakInHouse;
4136 v40 = window_SpeakInHouse->ptr_1C; 4192 v40 = window_SpeakInHouse->ptr_1C;
4156 if ( v45 ) 4212 if ( v45 )
4157 { 4213 {
4158 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); 4214 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
4159 //v3 = dword_F8B198; 4215 //v3 = dword_F8B198;
4160 v8 = window_SpeakInHouse; 4216 v8 = window_SpeakInHouse;
4161 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46]; 4217 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
4162 } 4218 }
4163 v42 = v8->ptr_1C; 4219 v42 = v8->ptr_1C;
4164 ++v43; 4220 ++v43;
4165 } 4221 }
4166 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4222 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
4178 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) 4234 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
4179 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID); 4235 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
4180 { 4236 {
4181 v49 = rand(); 4237 v49 = rand();
4182 v8 = window_SpeakInHouse; 4238 v8 = window_SpeakInHouse;
4183 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); 4239 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
4184 } 4240 }
4185 v47 = v8->ptr_1C; 4241 v47 = v8->ptr_1C;
4186 ++v48; 4242 ++v48;
4187 } 4243 }
4188 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4244 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
4201 if ( v50 ) 4257 if ( v50 )
4202 { 4258 {
4203 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE); 4259 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
4204 //v3 = dword_F8B198; 4260 //v3 = dword_F8B198;
4205 v8 = window_SpeakInHouse; 4261 v8 = window_SpeakInHouse;
4206 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51]; 4262 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
4207 } 4263 }
4208 v42 = v8->ptr_1C; 4264 v42 = v8->ptr_1C;
4209 ++v43; 4265 ++v43;
4210 } 4266 }
4211 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4267 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
4223 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] ) 4279 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
4224 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID) 4280 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
4225 { 4281 {
4226 v54 = rand(); 4282 v54 = rand();
4227 v8 = window_SpeakInHouse; 4283 v8 = window_SpeakInHouse;
4228 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight); 4284 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
4229 } 4285 }
4230 v52 = v8->ptr_1C; 4286 v52 = v8->ptr_1C;
4231 ++v53; 4287 ++v53;
4232 } 4288 }
4233 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4289 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );