diff mm7_2.cpp @ 477:35c0595ed61c

Слияние
author Ritor1
date Tue, 26 Feb 2013 07:59:16 +0600
parents c43f156a95c9
children 7dfe960c323c 7f1b00901cf7
line wrap: on
line diff
--- a/mm7_2.cpp	Tue Feb 26 07:59:07 2013 +0600
+++ b/mm7_2.cpp	Tue Feb 26 07:59:16 2013 +0600
@@ -1210,7 +1210,7 @@
     {
       draw_leather();
       CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-      sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
+      DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
       result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
       if ( result )
       {
@@ -1311,7 +1311,7 @@
       {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-        sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
+        DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
         result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
         if ( result )
         {
@@ -1349,7 +1349,7 @@
         {
           draw_leather();
           CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-          sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
+          DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
           result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
           if ( result )
           {
@@ -1417,13 +1417,13 @@
 	if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID);
       {
         v49 = word_F8B158[(signed int)v48];
-        v50 = dword_F8B168[(signed int)v48];
+        v50 = ItemsInShopTexture[(signed int)v48];
         v49 += 30;
         v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
         pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
         sub_40F92A(
           &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
-          dword_F8B168[(signed int)v109],
+          ItemsInShopTexture[(signed int)v109],
           (int)((char *)v109 + 1));
         v48 = v109;
       }
@@ -1440,15 +1440,15 @@
     do
     {
    //   if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
-	if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
+	if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
       {
         v52 = word_F8B158[(signed int)v109] + 30;
-        v53 = dword_F8B168[(signed int)v109];
+        v53 = ItemsInShopTexture[(signed int)v109];
         v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
         pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
         sub_40F92A(
           &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
-          dword_F8B168[(signed int)v109],
+          ItemsInShopTexture[(signed int)v109],
           (int)((char *)v109 + 1));
       }
       v109 = (const char **)((char *)v109 + 1);
@@ -1477,7 +1477,7 @@
       do
       {
        // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
+	  if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
           ++v106.x;
         ++v55;
       }
@@ -1496,7 +1496,7 @@
       if ( dword_F8B19C != 2 )
         v58 = pGlobalTXT_LocalizationStrings[196];
     }
-    sub_4B46A5(v58, 0);
+    DrawTextAtStatusBar(v58, 0);
     if ( v106.x )
     {
       v59 = pMouse->GetCursorPos(&v91);
@@ -1509,7 +1509,7 @@
       //  v62 = 9 * (v60 + 12 * v61);
         v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
         if ( dword_F8B19C != 2 )
-          v63 = &pParty->SpecialItemsInShop[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
+          v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
         if ( !v56 || !Str )
         {
           v85 = 0;
@@ -1532,11 +1532,8 @@
     }
     else
     {
-      result = v101._4B1854(
-                 __PAIR__(
-                   pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1],
-                   pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C])
-               - pParty->uTimePlayed);
+      v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C]  - pParty->uTimePlayed);
+	  result =0; //added
     }
   }
   return result;
@@ -1732,7 +1729,7 @@
       {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-        sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
+        DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
         result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
         if ( !result
           || (v43 = pMouse->GetCursorPos(&v99)->x - 14,
@@ -1757,7 +1754,7 @@
       {
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-        sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
+        DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
         result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
         if ( !result
           || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
@@ -1957,7 +1954,7 @@
        // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
 	  if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
         {
-          v46 = dword_F8B168[v114];
+          v46 = ItemsInShopTexture[v114];
           v47 = 152 - v46->uTextureHeight;
           if ( (signed int)v47 < 1 )
             v47 = 0;
@@ -1966,7 +1963,7 @@
           {
             if ( v114 == 5 )
             {
-              v49 = dword_F8B168[5]->uTextureWidth;
+              v49 = ItemsInShopTexture[5]->uTextureWidth;
               if ( (signed int)v48 > 457 - v49 )
                 v48 = 457 - v49;
             }
@@ -1977,7 +1974,7 @@
               v48 = 18;
           }
           pRenderer->DrawTextureTransparent(v48, v47, v46);
-          sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], dword_F8B168[v114], v114 + 1);
+          sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
         }
         ++v114;
       }
@@ -1988,7 +1985,7 @@
       //  if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
 	  if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
         {
-          v50 = dword_F8B168[v114 + 6];
+          v50 = ItemsInShopTexture[v114 + 6];
           v51 = 308 - v50->uTextureHeight;
           if ( (signed int)v51 < 1 )
             v51 = 0;
@@ -1997,7 +1994,7 @@
           {
             if ( v114 == 5 )
             {
-              v53 = dword_F8B168[11]->uTextureWidth;
+              v53 = ItemsInShopTexture[11]->uTextureWidth;
               if ( (signed int)v52 > 457 - v53 )
                 v52 = 457 - v53;
             }
@@ -2008,7 +2005,7 @@
               v52 = 18;
           }
           pRenderer->DrawTextureTransparent(v52, v51, v50);
-          sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v114 + 6], v114 + 7);
+          sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
         }
         ++v114;
       }
@@ -2019,9 +2016,9 @@
       do
       {
         //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
-        {
-          v54 = dword_F8B168[v114];
+	  if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
+        {
+          v54 = ItemsInShopTexture[v114];
           v55 = 152 - v54->uTextureHeight;
           if ( (signed int)v55 < 1 )
             v55 = 0;
@@ -2030,7 +2027,7 @@
           {
             if ( v114 == 5 )
             {
-              v57 = dword_F8B168[5]->uTextureWidth;
+              v57 = ItemsInShopTexture[5]->uTextureWidth;
               if ( (signed int)v56 > 457 - v57 )
                 v56 = 457 - v57;
             }
@@ -2041,7 +2038,7 @@
               v56 = 18;
           }
           pRenderer->DrawTextureTransparent(v56, v55, v54);
-          sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v114], v114 + 1);
+          sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
         }
         ++v114;
       }
@@ -2050,9 +2047,9 @@
       do
       {
        // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )   //weak 
-	     if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
-        {
-          v58 = dword_F8B168[v114 + 6];
+	     if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
+        {
+          v58 = ItemsInShopTexture[v114 + 6];
           v59 = 308 - v58->uTextureHeight;
           if ( (signed int)v59 < 1 )
             v59 = 0;
@@ -2061,7 +2058,7 @@
           {
             if ( v114 == 5 )
             {
-              v61 = dword_F8B168[11]->uTextureWidth;
+              v61 = ItemsInShopTexture[11]->uTextureWidth;
               if ( (signed int)v60 > 457 - v61 )
                 v60 = 457 - v61;
             }
@@ -2072,7 +2069,7 @@
               v60 = 18;
           }
           pRenderer->DrawTextureTransparent(v60, v59, v58);
-          sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v114 + 6], v114 + 7);
+          sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
         }
         ++v114;
       }
@@ -2099,7 +2096,7 @@
         do
         {
           //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-		if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
+		if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
             ++v109;
           ++v62;
         }
@@ -2118,13 +2115,12 @@
         if ( dword_F8B19C != 2 )
           v65 = pGlobalTXT_LocalizationStrings[196];
       }
-      sub_4B46A5(v65, 0);
+      DrawTextAtStatusBar(v65, 0);
       if ( !v109 )
-        return (POINT *)v104._4B1854(
-                          __PAIR__(
-                            pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1],
-                            pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C])
-                        - pParty->uTimePlayed);
+		  {
+        v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
+		return 0;
+		  }
       v66 = pMouse->GetCursorPos(&v98);
       result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
       if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
@@ -2135,7 +2131,7 @@
       //  v69 = 9 * (v67 + 12 * v68);
         v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
         if ( dword_F8B19C != 2 )
-          v70 = &pParty->SpecialItemsInShop[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
+          v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
         if ( !v63 || !Str )
         {
           v93 = 0;
@@ -2163,704 +2159,766 @@
 
 //----- (004BA928) --------------------------------------------------------
 void __cdecl ArmorShopDialog()
-{
-  Player *v0; // ebx@1
-  signed int v1; // esi@8
-  unsigned int v2; // eax@10
-  ItemGen *v3; // eax@11
-  unsigned __int8 v4; // dl@12
-  char *v5; // ecx@12
-  char *v6; // eax@13
-  int v7; // ST08_4@15
-  int v8; // eax@15
-  signed int v9; // esi@17
-  unsigned int v10; // eax@19
-  char *v11; // edi@19
-  int v12; // ST08_4@20
-  int v13; // eax@20
-  unsigned __int8 v14; // dl@20
-  char *v15; // ecx@20
-  char **v16; // edi@22
-  int v17; // ebx@22
-  char **v18; // esi@22
-  int v19; // eax@23
-  GUIWindow *v20; // ecx@24
-  int v21; // eax@24
-  int v22; // edx@24
-  int v23; // ebx@24
-  unsigned __int8 v24; // sf@24
-  GUIButton *v25; // eax@26
-  GUIButton *v26; // esi@26
-  int v27; // eax@26
-  unsigned int v28; // ecx@26
-  Player *v29; // edx@26
-  unsigned __int16 v30; // ax@26
-  signed int v31; // esi@31
-  unsigned int v32; // eax@33
-  int v33; // eax@34
-  int v34; // ST08_4@35
-  int v35; // eax@35
-  char *v36; // edx@36
-  GUIWindow *v37; // edi@42
-  signed int v38; // esi@42
-  unsigned int v39; // esi@44
-  int v40; // eax@44
-  unsigned int v41; // eax@45
-  int v42; // eax@47
-  int v43; // ecx@52
-  GUIButton *v44; // eax@54
-  GUIButton *v45; // esi@54
-  int v46; // eax@54
-  char *v47; // eax@56
-  int v48; // eax@56
-  unsigned int v49; // ecx@56
-  int v50; // edx@56
-  int v51; // eax@56
-  unsigned __int16 v52; // ax@56
-  int v53; // eax@60
-  int v54; // eax@60
-  signed int v55; // ebx@65
-  Texture *v56; // eax@67
-  unsigned int v57; // edi@68
-  Texture *v58; // ST1C_4@68
-  int v59; // eax@68
-  int v60; // edi@69
-  signed int v61; // ebx@73
-  Texture *v62; // eax@75
-  int v63; // edi@76
-  Texture *v64; // ST1C_4@76
-  unsigned int v65; // ST18_4@76
-  int v66; // eax@76
-  int v67; // edi@77
-  signed int v68; // ecx@81
-  SHORT v69; // bx@89
-  bool v70; // eax@89
-  const char *v71; // ecx@91
-  void *v72; // eax@95
-  POINT *v73; // esi@97
-  int v74; // ecx@97
-  int v75; // eax@98
-  int v76; // ecx@98
-  ItemGen *v77; // ecx@99
-  unsigned __int8 v78; // bl@104
-  char **v79; // edi@105
-  int v80; // ebx@105
-  char **v81; // esi@105
-  int v82; // eax@106
-  GUIWindow *v83; // ecx@107
-  int v84; // eax@107
-  int v85; // edx@107
-  int v86; // ebx@107
-  GUIButton *v87; // eax@109
-  GUIButton *v88; // esi@109
-  int v89; // eax@109
-  unsigned int v90; // ecx@109
-  int v91; // edx@109
-  unsigned __int16 v92; // ax@109
-  signed int v93; // edx@114
-  POINT *v94; // edi@120
-  __int32 v95; // ecx@120
-  void *v96; // ST14_4@122
-  unsigned __int8 v97; // bl@122
-  ItemGen *v98; // ST10_4@122
-  int v99; // eax@122
-  char *v100; // eax@122
-  const char *v101; // ST18_4@122
-  unsigned __int16 v102; // ST14_2@122
-  int v103; // eax@122
-  signed int v104; // edi@123
-  Texture *v105; // eax@125
-  int v106; // ebx@126
-  Texture *v107; // ST1C_4@126
-  unsigned int v108; // ST18_4@126
-  int v109; // eax@126
-  int v110; // ebx@127
-  GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
-  unsigned int v112; // [sp-14h] [bp-118h]@13
-  int v113; // [sp-14h] [bp-118h]@36
-  ItemGen *v114; // [sp-10h] [bp-114h]@12
-  unsigned int v115; // [sp-10h] [bp-114h]@13
-  ItemGen *v116; // [sp-10h] [bp-114h]@20
-  int v117; // [sp-10h] [bp-114h]@36
-  void *v118; // [sp-Ch] [bp-110h]@12
-  unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
-  void *v120; // [sp-Ch] [bp-110h]@20
-  char *v121; // [sp-8h] [bp-10Ch]@13
-  int v122; // [sp-8h] [bp-10Ch]@20
-  unsigned int v123; // [sp-4h] [bp-108h]@13
-  __int64 *v124; // [sp-4h] [bp-108h]@20
-  int v125; // [sp-4h] [bp-108h]@68
-  int v126; // [sp-4h] [bp-108h]@76
-  int v127; // [sp-4h] [bp-108h]@126
-  POINT v128; // [sp+Ch] [bp-F8h]@8
-  POINT v129; // [sp+14h] [bp-F0h]@18
-  char v130; // [sp+1Ch] [bp-E8h]@120
-  POINT a2; // [sp+24h] [bp-E0h]@8
-  POINT v132; // [sp+2Ch] [bp-D8h]@120
-  POINT v133; // [sp+34h] [bp-D0h]@17
-  char v134; // [sp+3Ch] [bp-C8h]@97
-  POINT v135; // [sp+44h] [bp-C0h]@31
-  POINT v136; // [sp+4Ch] [bp-B8h]@97
-  POINT v137; // [sp+54h] [bp-B0h]@17
-  POINT v138; // [sp+5Ch] [bp-A8h]@32
-  POINT v139; // [sp+64h] [bp-A0h]@17
-  POINT v140; // [sp+6Ch] [bp-98h]@31
-  POINT v141; // [sp+74h] [bp-90h]@8
-  POINT v142; // [sp+7Ch] [bp-88h]@31
-  POINT v143; // [sp+84h] [bp-80h]@9
-  GUIWindow v144; // [sp+8Ch] [bp-78h]@1
-  char *Str; // [sp+E0h] [bp-24h]@56
-  int v146; // [sp+E4h] [bp-20h]@24
-  int v147; // [sp+E8h] [bp-1Ch]@1
-  int v148; // [sp+ECh] [bp-18h]@1
-  __int32 v149; // [sp+F0h] [bp-14h]@8
-  Player *_this; // [sp+F4h] [bp-10h]@1
-  unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
-  int v152; // [sp+FCh] [bp-8h]@24
-  int v153; // [sp+100h] [bp-4h]@44
-
-  v0 = pPlayers[uActiveCharacter];
-  _this = pPlayers[uActiveCharacter];
-  memcpy(&v144, window_SpeakInHouse, sizeof(v144));
-  v144.uFrameX = 483;
-  v144.uFrameWidth = 148;
-  v144.uFrameZ = 334;
-  v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
-  v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
-  if ( dword_F8B19C > 5 )
-  {
-    if ( dword_F8B19C == 6 )
-    {
-      pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
-      sub_4B46A5(pGlobalTXT_LocalizationStrings[195], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-        return;
-      v149 = 0;
-      v93 = 0;
-      do
-      {
-       // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID)
-          ++v149;
-        ++v93;
-      }
-      while ( v93 < 8 );
-      if ( v149 )
-      {
-        v94 = pMouse->GetCursorPos(&v132);
-        v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
-        v95 = v149;
-        if ( v149 && v149 != -65536 )
-        {
-          --v149;
-          v96 = window_SpeakInHouse->ptr_1C;
-          v97 = uActiveCharacter - 1;
-       //   v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
-          v99 = _this->_490EEE(
-                 &pParty->SpecialItemsInShop[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
-                  2,
-                  (int)window_SpeakInHouse->ptr_1C,
-                  2);
-          v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
-          v101 = v100;
-          v102 = v148;
-          v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
-          v144.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
-        }
-        v104 = 0;
-        v153 = 0;
-        do
-        {
-          //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-		if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID)
-          {
-            v105 = dword_F8B168[v104];
-            if ( v104 >= 4 )
-            {
-              v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
-              pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, dword_F8B168[v104]);
-              v127 = v104 + 1;
-              v109 = v153 + v110 + 80220;
-            }
-            else
-            {
-              v106 = 98 - v105->uTextureHeight;
-              v107 = dword_F8B168[v104];
-              v108 = 98 - v105->uTextureHeight;
-              v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
-              pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
-              v127 = v104 + 1;
-              v109 = v152 + v153 + 640 * v106;
-            }
-            ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], dword_F8B168[v104], v127);
-          }
-          v153 += 105;
-          ++v104;
-        }
-        while ( v104 < 8 );
-        return;
-      }
-      v72 = window_SpeakInHouse->ptr_1C;
-      goto LABEL_96;
-    }
-    if ( dword_F8B19C == 94 )
-    {
-      draw_leather();
-      CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-      v79 = pShopOptions;
-      pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
-      pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
-      pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
-      v80 = 0;
-      v81 = pShopOptions;
-      do
-      {
-        v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
-        ++v81;
-        v80 += v82;
-      }
-      while ( (signed int)v81 < (signed int)&pShopOptions[3] );
-      v83 = pDialogueWindow;
-      v152 = (174 - v80) / 3;
-      v84 = pDialogueWindow->pStartingPosActiveItem;
-      v85 = v84 + pDialogueWindow->pNumPresenceButton;
-      v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
-      v24 = -pDialogueWindow->pNumPresenceButton < 0;
-      _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
-      if ( v24 ^ __OFSUB__(v84, v85) )
-      {
-        v153 = 2;
-        do
-        {
-          v87 = v83->GetControl((unsigned int)_this);
-          v88 = v87;
-          v87->uY = v152 + v86;
-          v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
-          v90 = v88->uY;
-          v91 = v153;
-          v88->uHeight = v89;
-          v86 = v90 + v89 - 1;
-          v88->uW = v86;
-          v92 = v147;
-          if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
-            v92 = v148;
-          v144.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u);
-          v83 = pDialogueWindow;
-          ++v153;
-          ++v79;
-          _this = (Player *)((char *)_this + 1);
-        }
-        while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
-      }
-      return;
-    }
-    if ( dword_F8B19C != 95 )
-    {
-      if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-        return;
-      v152 = 0;
-      v37 = pDialogueWindow;
-      //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
-      v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
-      _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
-      if ( (signed int)_this < v38 / 3 )
-        _this = (Player *)(v38 / 3);
-      v39 = v37->pStartingPosActiveItem;
-      v40 = v37->pNumPresenceButton;
-      v153 = 0;
-      if ( (signed int)v39 < (signed int)(v39 + v40) )
-      {
-        do
-        {
-          v41 = v37->GetControl(v39)->uControlParam - 36;
-          if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v41] && !v0->pActiveSkills[v41] )
-          {
-            v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
-            v152 += v42;
-            ++v153;
-          }
-          ++v39;
-        }
-        while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
-        if ( v153 )
-        {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
-          v144.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
-          _this = (Player *)((149 - v152) / v153);
-          if ( (149 - v152) / v153 > 32 )
-            _this = (Player *)32;
-          v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
-          v152 = v37->pStartingPosActiveItem;
-          v146 = v43;
-          if ( v152 < v152 + v37->pNumPresenceButton )
-          {
-            v153 = 2;
-            do
-            {
-              v44 = v37->GetControl(v152);
-              v45 = v44;
-              v46 = v44->uControlParam - 36;
-              if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v46] || v0->pActiveSkills[v46] )
-              {
-                v45->uW = 0;
-                v45->uHeight = 0;
-                v45->uY = 0;
-              }
-              else
-              {
-                v47 = pSkillNames[v46];
-                v45->uY = (unsigned int)((char *)_this + v146);
-                Str = v47;
-                v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
-                v49 = v45->uY;
-                v50 = v153;
-                v45->uHeight = v48;
-                v51 = v49 + v48 - 1;
-                v45->uW = v51;
-                v146 = v51;
-                v52 = v147;
-                if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
-                  v52 = v148;
-                v144.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u);
-              }
-              v53 = v37->pStartingPosActiveItem;
-              ++v152;
-              v54 = v37->pNumPresenceButton + v53;
-              ++v153;
-            }
-            while ( v152 < v54 );
-          }
-          return;
-        }
-      }
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);
-      strcat(pTmpBuf, "\n \n");
-      strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-      v11 = 0;
-      v36 = pTmpBuf;
-      v123 = 3;
-      v121 = pTmpBuf;
-      v119 = v147;
-      v117 = 0;
-      v113 = 0;
-      v111 = &v144;
-LABEL_63:
-      v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
-      v112 = (unsigned int)v11;
-LABEL_14:
-      v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
-      return;
-    }
-LABEL_64:
-    pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
-    if ( dword_F8B19C == 2 )
-    {
-      v55 = 0;
-      v153 = 0;
-      do
-      {
-      //  if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
-	  if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);
-        {
-          v56 = dword_F8B168[v55];
-          if ( v55 >= 4 )
-          {
-            v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
-            pRenderer->DrawTextureTransparent(v60 + v153 - 420, 0x7Eu, dword_F8B168[v55]);
-            v125 = v55 + 1;
-            v59 = v60 + v153 + 80220;
-          }
-          else
-          {
-            v57 = 98 - v56->uTextureHeight;
-            v58 = dword_F8B168[v55];
-            v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
-            pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
-            v125 = v55 + 1;
-            v59 = v153 + v152 + 640 * v57;
-          }
-          ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], dword_F8B168[v55], v125);
-        }
-        v153 += 105;
-        ++v55;
-      }
-      while ( v55 < 8 );
-      v11 = 0;
-    }
-    else
-    {
-      v11 = 0;
-      v61 = 0;
-      v153 = 0;
-      do
-      {
-       // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
-	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID)
-        {
-          v62 = dword_F8B168[v61];
-          if ( v61 >= 4 )
-          {
-            v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
-            pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, dword_F8B168[v61]);
-            v126 = v61 + 1;
-            v66 = v153 + v67 + 80220;
-          }
-          else
-          {
-            v63 = 98 - v62->uTextureHeight;
-            v64 = dword_F8B168[v61];
-            v65 = 98 - v62->uTextureHeight;
-            v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
-            pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
-            v126 = v61 + 1;
-            v66 = v152 + v153 + 640 * v63;
-          }
-          ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], dword_F8B168[v61], v126);
-          v11 = 0;
-        }
-        v153 += 105;
-        ++v61;
-      }
-      while ( v61 < 8 );
-    }
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-      return;
-    v68 = 0;
-    v149 = (__int32)v11;
-    if ( dword_F8B19C == 2 )
-    {
-      do
-      {
-       // if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 )
-	  if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v68].uItemID);
-          ++v149;
-        ++v68;
-      }
-      while ( v68 < 6 );
-    }
-    else
-    {
-      do
-      {
-       // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
-	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID)
-          ++v149;
-        ++v68;
-      }
-      while ( v68 < 6 );
-    }
-    v69 = GetAsyncKeyState(17);
-    v70 = _this->CanSteal();
-    Str = (char *)v70;
-    if ( v69 == (short)v11 || (char *)v70 == v11 )
-    {
-      v71 = pGlobalTXT_LocalizationStrings[195];
-      if ( dword_F8B19C != 2 )
-        v71 = pGlobalTXT_LocalizationStrings[196];
-    }
-    else
-    {
-      v71 = pGlobalTXT_LocalizationStrings[185];
-    }
-    sub_4B46A5(v71, 0);
-    if ( (char *)v149 != v11 )
-    {
-      v73 = pMouse->GetCursorPos(&v136);
-      v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
-      if ( !v74 )
-        return;
-      v149 = v74 - 1;
-      v75 = (int)window_SpeakInHouse->ptr_1C;
-      v76 = 9 * (v74 - 1 + 12 * v75);
-      if ( dword_F8B19C == 2 )
-        v77 = (ItemGen *)&pParty->StandartItemsInShops[v76];
-      else
-        v77 = &pParty->SpecialItemsInShop[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
-      if ( v69 == (short)v11 || Str == v11 )
-      {
-        v124 = (__int64 *)v11;
-        v122 = 2;
-        v120 = window_SpeakInHouse->ptr_1C;
-        v116 = v77;
-        v78 = uActiveCharacter - 1;
-        v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
-        v14 = v78;
-      }
-      else
-      {
-        v124 = (__int64 *)v11;
-        v122 = 2;
-        v120 = window_SpeakInHouse->ptr_1C;
-        v116 = v77;
-        v15 = pGlobalTXT_LocalizationStrings[181];
-        v14 = uActiveCharacter - 1;
-      }
-LABEL_36:
-      v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
-      v123 = 3;
-      v121 = v36;
-      v119 = v148;
-      v117 = (int)v11;
-      v113 = (int)v11;
-      v111 = &v144;
-      goto LABEL_63;
-    }
-    v72 = window_SpeakInHouse->ptr_1C;
-LABEL_96:
-    v144._4B1854(
-      __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72])
-    - pParty->uTimePlayed);
-    return;
-  }
-  if ( dword_F8B19C == 5 )
-  {
-    draw_leather();
-    CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-    sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
-      || (v31 = pMouse->GetCursorPos(&v135)->x - 14,
-          v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
-          pMouse->GetCursorPos(&v140)->x <= 13)
-      || pMouse->GetCursorPos(&v138)->x >= 462
-      || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
-      || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
-      return;
-    v124 = 0;
-    v122 = 5;
-    v120 = window_SpeakInHouse->ptr_1C;
-    v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
-    v34 = (int)window_SpeakInHouse->ptr_1C;
-    uPlayerID = uActiveCharacter - 1;
-    v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
-    v14 = uPlayerID;
-    v15 = (char *)pMerchantsRepairPhrases[v35];
-    goto LABEL_36;
-  }
-  if ( dword_F8B19C == 1 )
-  {
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-    {
-      v16 = pShopOptions;
-      pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
-      pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
-      pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
-      v17 = 0;
-      pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
-      v18 = pShopOptions;
-      do
-      {
-        v19 = pFontArrus->CalcTextHeight(*v18, &v144, 0, 0);
-        ++v18;
-        v17 += v19;
-      }
-      while ( (signed int)v18 < (signed int)&unk_F8B1C8 );
-      v20 = pDialogueWindow;
-      v146 = (174 - v17) / 4;
-      v21 = pDialogueWindow->pStartingPosActiveItem;
-      v22 = v21 + pDialogueWindow->pNumPresenceButton;
-      v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
-      v24 = -pDialogueWindow->pNumPresenceButton < 0;
-      v152 = pDialogueWindow->pStartingPosActiveItem;
-      if ( v24 ^ __OFSUB__(v21, v22) )
-      {
-        _this = (Player *)2;
-        do
-        {
-          v25 = v20->GetControl(v152);
-          v26 = v25;
-          v25->uY = v146 + v23;
-          v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
-          v28 = v26->uY;
-          v29 = _this;
-          v26->uHeight = v27;
-          v23 = v28 + v27 - 1;
-          v26->uW = v23;
-          v30 = v147;
-          if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 )
-            v30 = v148;
-          v144.DrawTitleText(pFontArrus, 0, v28, v30, *v16, 3u);
-          v20 = pDialogueWindow;
-          _this = (Player *)((char *)_this + 1);
-          ++v16;
-          ++v152;
-        }
-        while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
-      }
-    }
-    return;
-  }
-  if ( dword_F8B19C == 2 )
-    goto LABEL_64;
-  if ( dword_F8B19C == 3 )
-  {
-    draw_leather();
-    CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-    sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
-      || (v9 = pMouse->GetCursorPos(&v139)->x - 14,
-          v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
-          pMouse->GetCursorPos(&v137)->x <= 13)
-      || pMouse->GetCursorPos(&v129)->x >= 462
-      || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
-      return;
-    v124 = 0;
-    v122 = 3;
-    v120 = window_SpeakInHouse->ptr_1C;
-    v116 = (ItemGen *)&v0->pInventoryItems[v10-1];
-    v12 = (int)window_SpeakInHouse->ptr_1C;
-    uPlayerID = uActiveCharacter - 1;
-    v13 = v0->_490EEE(v116, 2, v12, 3);
-    v14 = uPlayerID;
-    v15 = (char *)pMerchantsSellPhrases[v13];
-    goto LABEL_36;
-  }
-  if ( dword_F8B19C == 4 )
-  {
-    draw_leather();
-    CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-    sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-    {
-      v1 = pMouse->GetCursorPos(&a2)->x - 14;
-      v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
-      if ( pMouse->GetCursorPos(&v141)->x > 13 )
-      {
-        if ( pMouse->GetCursorPos(&v143)->x < 462 )
-        {
-          v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
-          if ( v2 )
-          {
-            v3 = (ItemGen *)&v0->pInventoryItems[v2-1];
-            if (v3->Identified())
-            {
-              v118 = window_SpeakInHouse->ptr_1C;
-              v4 = uActiveCharacter - 1;
-              v5 = "%24";
-              v114 = v3;
-            }
-            else
-            {
-              v118 = window_SpeakInHouse->ptr_1C;
-              v114 = v3;
-              v7 = (int)window_SpeakInHouse->ptr_1C;
-              uPlayerID = uActiveCharacter - 1;
-              v8 = v0->_490EEE(v3, 2, v7, 4);
-              v4 = uPlayerID;
-              v5 = (char *)pMerchantsIdentifyPhrases[v8];
-            }
-            v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0);
-            v123 = 3;
-            v121 = v6;
-            v119 = v148;
-            v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
-            v112 = 0;
-            goto LABEL_14;
-          }
-        }
-      }
-    }
-  }
-}
+	{
+	Player *v0; // ebx@1
+	signed int v1; // esi@8
+	unsigned int v2; // eax@10
+	ItemGen *v3; // eax@11
+	unsigned __int8 v4; // dl@12
+	char *v5; // ecx@12
+	char *v6; // eax@13
+	int v7; // ST08_4@15
+	int v8; // eax@15
+	signed int v9; // esi@17
+	unsigned int v10; // eax@19
+	char *v11; // edi@19
+	int v12; // ST08_4@20
+	int v13; // eax@20
+	unsigned __int8 v14; // dl@20
+	char *v15; // ecx@20
+	char **v16; // edi@22
+	int v17; // ebx@22
+	char **v18; // esi@22
+	int v19; // eax@23
+	GUIWindow *v20; // ecx@24
+	int v21; // eax@24
+	int v22; // edx@24
+	int v23; // ebx@24
+	unsigned __int8 v24; // sf@24
+	GUIButton *v25; // eax@26
+	GUIButton *v26; // esi@26
+	int v27; // eax@26
+	unsigned int v28; // ecx@26
+	Player *v29; // edx@26
+	unsigned __int16 v30; // ax@26
+	signed int v31; // esi@31
+	unsigned int v32; // eax@33
+	int v33; // eax@34
+	int v34; // ST08_4@35
+	int v35; // eax@35
+	char *v36; // edx@36
+	GUIWindow *v37; // edi@42
+	signed int v38; // esi@42
+	unsigned int v39; // esi@44
+	int v40; // eax@44
+	unsigned int v41; // eax@45
+	int v42; // eax@47
+	int v43; // ecx@52
+	GUIButton *v44; // eax@54
+	GUIButton *v45; // esi@54
+	int v46; // eax@54
+	char *v47; // eax@56
+	int v48; // eax@56
+	unsigned int v49; // ecx@56
+	int v50; // edx@56
+	int v51; // eax@56
+	unsigned __int16 v52; // ax@56
+	int v53; // eax@60
+	int v54; // eax@60
+	signed int v55; // ebx@65
+	Texture *v56; // eax@67
+	unsigned int v57; // edi@68
+	Texture *v58; // ST1C_4@68
+	int v59; // eax@68
+	int v60; // edi@69
+	signed int v61; // ebx@73
+	Texture *v62; // eax@75
+	int v63; // edi@76
+	Texture *v64; // ST1C_4@76
+	unsigned int v65; // ST18_4@76
+	int v66; // eax@76
+	int v67; // edi@77
+	signed int v68; // ecx@81
+	SHORT v69; // bx@89
+	bool v70; // eax@89
+	const char *v71; // ecx@91
+	void *v72; // eax@95
+	POINT *v73; // esi@97
+	int v74; // ecx@97
+	int v75; // eax@98
+	int v76; // ecx@98
+	ItemGen *v77; // ecx@99
+	unsigned __int8 v78; // bl@104
+	char **v79; // edi@105
+	int v80; // ebx@105
+	char **v81; // esi@105
+	int v82; // eax@106
+	GUIWindow *v83; // ecx@107
+	int v84; // eax@107
+	int v85; // edx@107
+	int v86; // ebx@107
+	GUIButton *v87; // eax@109
+	GUIButton *v88; // esi@109
+	int v89; // eax@109
+	unsigned int v90; // ecx@109
+	int v91; // edx@109
+	unsigned __int16 v92; // ax@109
+	signed int v93; // edx@114
+	POINT *v94; // edi@120
+	__int32 v95; // ecx@120
+	void *v96; // ST14_4@122
+	unsigned __int8 v97; // bl@122
+	ItemGen *v98; // ST10_4@122
+	int v99; // eax@122
+	char *v100; // eax@122
+	const char *v101; // ST18_4@122
+	unsigned __int16 v102; // ST14_2@122
+	int v103; // eax@122
+	signed int v104; // edi@123
+	Texture *v105; // eax@125
+	int v106; // ebx@126
+	Texture *v107; // ST1C_4@126
+	unsigned int v108; // ST18_4@126
+	int v109; // eax@126
+	int v110; // ebx@127
+	GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
+	unsigned int v112; // [sp-14h] [bp-118h]@13
+	int v113; // [sp-14h] [bp-118h]@36
+	ItemGen *v114; // [sp-10h] [bp-114h]@12
+	unsigned int v115; // [sp-10h] [bp-114h]@13
+	ItemGen *v116; // [sp-10h] [bp-114h]@20
+	int v117; // [sp-10h] [bp-114h]@36
+	void *v118; // [sp-Ch] [bp-110h]@12
+	unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
+	void *v120; // [sp-Ch] [bp-110h]@20
+	char *v121; // [sp-8h] [bp-10Ch]@13
+	int v122; // [sp-8h] [bp-10Ch]@20
+	unsigned int v123; // [sp-4h] [bp-108h]@13
+	__int64 *v124; // [sp-4h] [bp-108h]@20
+	int v125; // [sp-4h] [bp-108h]@68
+	int v126; // [sp-4h] [bp-108h]@76
+	int v127; // [sp-4h] [bp-108h]@126
+	POINT v128; // [sp+Ch] [bp-F8h]@8
+	POINT v129; // [sp+14h] [bp-F0h]@18
+	char v130; // [sp+1Ch] [bp-E8h]@120
+	POINT a2; // [sp+24h] [bp-E0h]@8
+	POINT v132; // [sp+2Ch] [bp-D8h]@120
+	POINT v133; // [sp+34h] [bp-D0h]@17
+	POINT v134; // [sp+3Ch] [bp-C8h]@97
+	POINT v135; // [sp+44h] [bp-C0h]@31
+	POINT v136; // [sp+4Ch] [bp-B8h]@97
+	POINT v137; // [sp+54h] [bp-B0h]@17
+	POINT v138; // [sp+5Ch] [bp-A8h]@32
+	POINT v139; // [sp+64h] [bp-A0h]@17
+	POINT v140; // [sp+6Ch] [bp-98h]@31
+	POINT v141; // [sp+74h] [bp-90h]@8
+	POINT v142; // [sp+7Ch] [bp-88h]@31
+	POINT v143; // [sp+84h] [bp-80h]@9
+	GUIWindow v144; // [sp+8Ch] [bp-78h]@1
+	char *Str; // [sp+E0h] [bp-24h]@56
+	int v146; // [sp+E4h] [bp-20h]@24
+	int v147; // [sp+E8h] [bp-1Ch]@1
+	int v148; // [sp+ECh] [bp-18h]@1
+	__int32 v149; // [sp+F0h] [bp-14h]@8
+	Player* _this; // [sp+F4h] [bp-10h]@1
+	unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
+	int v152; // [sp+FCh] [bp-8h]@24
+	int v153; // [sp+100h] [bp-4h]@44
+	int th;
+
+	v0 = pPlayers[uActiveCharacter];
+	_this = pPlayers[uActiveCharacter];
+	memcpy(&v144, window_SpeakInHouse, sizeof(v144));
+	v144.uFrameX = 483;
+	v144.uFrameWidth = 148;
+	v144.uFrameZ = 334;
+	v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
+	v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
+	switch (dword_F8B19C)
+		{
+	case 1:  //prepare shop text
+		{
+		if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+			{
+			v16 = pShopOptions;
+			pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
+			pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
+			pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
+			v17 = 0;
+			pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
+			for(int i=0;i<4;++i)
+				{
+				v19 = pFontArrus->CalcTextHeight(pShopOptions[i], &v144, 0, 0);
+				v17 += v19;
+				}
+			v20 = pDialogueWindow;
+			v146 = (174 - v17) / 4;
+			v21 = pDialogueWindow->pStartingPosActiveItem;
+			v22 = v21 + pDialogueWindow->pNumPresenceButton;
+			v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
+			v24 = -pDialogueWindow->pNumPresenceButton < 0;
+			v152 = pDialogueWindow->pStartingPosActiveItem;
+			if ( v24 ^ __OFSUB__(v21, v22) )
+				{
+				th = 2;
+				do
+					{
+					v25 = v20->GetControl(v152);
+					v26 = v25;
+					v25->uY = v146 + v23;
+					v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
+					v28 = v26->uY;
+					v29 = _this;
+					v26->uHeight = v27;
+					v23 = v28 + v27 - 1;
+					v26->uW = v23;
+					v30 = v147;
+					if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 )
+						v30 = v148;
+					v144.DrawTitleText(pFontArrus, 0, v28, v30, *v16, 3u);
+					v20 = pDialogueWindow;
+					++th;
+					++v16;
+					++v152;
+					}
+					while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
+				}
+			}
+		}
+		break;
+	case 2: //buy standart
+		{
+		pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
+		v55 = 0;
+		v153 = 0;
+		for(int i=0; i<8; ++i)
+			{
+			//  if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+			if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID);
+				{
+				v56 = ItemsInShopTexture[v55];
+				if ( i >= 4 )
+					{
+					v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
+					pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
+					v59 = v60 + v153 + 80220;
+					}
+				else
+					{
+					v57 = 98 - v56->uTextureHeight;
+					v58 = ItemsInShopTexture[i];
+					v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
+					pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
+					v59 = v153 + v152 + 640 * v57;
+					}
+				ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i+1);
+				}
+				v153 += 105;
+
+			}
+
+		v11 = 0;
+		if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+			return;
+
+		v149 = 0;
+		for(int i=0; i<6; ++i)
+		{
+		// if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 )
+		if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID);
+		++v149;
+	
+		}
+		
+		v69 = GetAsyncKeyState(17);
+		v70 = _this->CanSteal();
+		//Str = (char *)v70;
+		if ( v69 == 0 || v70 == 0 )
+			{
+			v71 = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
+			}
+		else
+			{
+			v71 = pGlobalTXT_LocalizationStrings[185];//"Steal item"
+			}
+		DrawTextAtStatusBar(v71, 0);
+		if ( v149 != 0 )
+			{
+			v73 = pMouse->GetCursorPos(&v136);
+			v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
+			if ( !v74 )
+				return;
+			v149 = v74 - 1;
+			v75 = (int)window_SpeakInHouse->ptr_1C;
+			v77 = &pParty->StandartItemsInShops[(int)v75][v74-1];
+			if ( v69 ==0 || v70 == 0)
+				{
+				v120 = window_SpeakInHouse->ptr_1C;
+				v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
+				}
+			else
+				{
+				v120 = window_SpeakInHouse->ptr_1C;
+				v15 = pGlobalTXT_LocalizationStrings[181];
+				}
+			v36 = BuilDialogueString(v15, uActiveCharacter - 1, v77, (char *)v120, 2, 0);
+			v115 = (174 - pFontArrus->CalcTextHeight(v36, &v144, 0, 0)) / 2 + 138;
+			v144.DrawTitleText(pFontArrus, 0, v115, v148, v36, 3);
+			return;
+			}
+		v72 = window_SpeakInHouse->ptr_1C;
+		v144.DrawCurrentTime( pParty->field_3C.field_50[(int)v72]- pParty->uTimePlayed);
+		return;
+		}
+		break;
+	case 3:
+		{
+		draw_leather();
+		CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+		DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
+		if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
+			|| (v9 = pMouse->GetCursorPos(&v139)->x - 14,
+			v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
+			pMouse->GetCursorPos(&v137)->x <= 13)
+			|| pMouse->GetCursorPos(&v129)->x >= 462
+			|| (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
+			return;
+		v124 = 0;
+		v122 = 3;
+		v120 = window_SpeakInHouse->ptr_1C;
+		v116 = (ItemGen *)&v0->pInventoryItems[v10-1];
+		v12 = (int)window_SpeakInHouse->ptr_1C;
+		uPlayerID = uActiveCharacter - 1;
+		v13 = v0->_490EEE(v116, 2, v12, 3);
+		v14 = uPlayerID;
+		v15 = (char *)pMerchantsSellPhrases[v13];
+		v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
+		v123 = 3;
+		v121 = v36;
+		v119 = v148;
+		v117 = (int)v11;
+		v113 = (int)v11;
+		v111 = &v144;
+		v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
+		v112 = (unsigned int)v11;
+		v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
+		return;
+		}
+		break;
+	case 4:
+		{
+		draw_leather();
+		CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+		DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
+		if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+			{
+			v1 = pMouse->GetCursorPos(&a2)->x - 14;
+			v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
+			if ( pMouse->GetCursorPos(&v141)->x > 13 )
+				{
+				if ( pMouse->GetCursorPos(&v143)->x < 462 )
+					{
+					v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
+					if ( v2 )
+						{
+						v3 = (ItemGen *)&v0->pInventoryItems[v2-1];
+						if (v3->Identified())
+							{
+							v118 = window_SpeakInHouse->ptr_1C;
+							v4 = uActiveCharacter - 1;
+							v5 = "%24";
+							v114 = v3;
+							}
+						else
+							{
+							v118 = window_SpeakInHouse->ptr_1C;
+							v114 = v3;
+							v7 = (int)window_SpeakInHouse->ptr_1C;
+							uPlayerID = uActiveCharacter - 1;
+							v8 = v0->_490EEE(v3, 2, v7, 4);
+							v4 = uPlayerID;
+							v5 = (char *)pMerchantsIdentifyPhrases[v8];
+							}
+						v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0);
+						v123 = 3;
+						v121 = v6;
+						v119 = v148;
+						v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
+						v112 = 0;
+						v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
+						return;
+						}
+					}
+				}
+			}
+		}
+		break;
+	case 5:
+		{
+		draw_leather();
+		CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+		DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
+		if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
+			|| (v31 = pMouse->GetCursorPos(&v135)->x - 14,
+			v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
+			pMouse->GetCursorPos(&v140)->x <= 13)
+			|| pMouse->GetCursorPos(&v138)->x >= 462
+			|| (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
+			|| (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
+			return;
+		v124 = 0;
+		v122 = 5;
+		v120 = window_SpeakInHouse->ptr_1C;
+		v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
+		v34 = (int)window_SpeakInHouse->ptr_1C;
+		uPlayerID = uActiveCharacter - 1;
+		v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
+		v14 = uPlayerID;
+		v15 = (char *)pMerchantsRepairPhrases[v35];
+		v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
+		v123 = 3;
+		v121 = v36;
+		v119 = v148;
+		v117 = (int)v11;
+		v113 = (int)v11;
+		v111 = &v144;
+		v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
+		v112 = (unsigned int)v11;
+		v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
+		return;
+		}
+		break;
+	case 6:
+		{
+		pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
+		DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0);
+		if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+			return;
+		v149 = 0;
+		v93 = 0;
+		do
+			{
+			// if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+			if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID)
+				++v149;
+			++v93;
+			}
+			while ( v93 < 8 );
+			if ( v149 )
+				{
+				v94 = pMouse->GetCursorPos(&v132);
+				v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
+				v95 = v149;
+				if ( v149 && v149 != -65536 )
+					{
+					--v149;
+					v96 = window_SpeakInHouse->ptr_1C;
+					v97 = uActiveCharacter - 1;
+					//   v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
+					v99 = _this->_490EEE(
+						&pParty->SpecialItemsInShops[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
+						2,
+						(int)window_SpeakInHouse->ptr_1C,
+						2);
+					v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
+					v101 = v100;
+					v102 = v148;
+					v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
+					v144.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
+					}
+				v104 = 0;
+				v153 = 0;
+				do
+					{
+					//if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+					if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID)
+						{
+						v105 = ItemsInShopTexture[v104];
+						if ( v104 >= 4 )
+							{
+							v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
+							pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
+							v127 = v104 + 1;
+							v109 = v153 + v110 + 80220;
+							}
+						else
+							{
+							v106 = 98 - v105->uTextureHeight;
+							v107 = ItemsInShopTexture[v104];
+							v108 = 98 - v105->uTextureHeight;
+							v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
+							pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
+							v127 = v104 + 1;
+							v109 = v152 + v153 + 640 * v106;
+							}
+						ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
+						}
+					v153 += 105;
+					++v104;
+					}
+					while ( v104 < 8 );
+					return;
+				}
+			v72 = window_SpeakInHouse->ptr_1C;
+			v144.DrawCurrentTime(pParty->field_3C.field_50[(int)v72]-  pParty->uTimePlayed);
+			return;
+		}
+		break;
+	case 94:
+		{
+		draw_leather();
+		CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+		v79 = pShopOptions;
+		pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
+		pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
+		pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
+		v80 = 0;
+		v81 = pShopOptions;
+		do
+			{
+			v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
+			++v81;
+			v80 += v82;
+			}
+			while ( (signed int)v81 < (signed int)&pShopOptions[3] );
+			v83 = pDialogueWindow;
+			v152 = (174 - v80) / 3;
+			v84 = pDialogueWindow->pStartingPosActiveItem;
+			v85 = v84 + pDialogueWindow->pNumPresenceButton;
+			v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
+			v24 = -pDialogueWindow->pNumPresenceButton < 0;
+			_this = (Player *)pDialogueWindow->pStartingPosActiveItem;
+			if ( v24 ^ __OFSUB__(v84, v85) )
+				{
+				v153 = 2;
+				do
+					{
+					v87 = v83->GetControl((unsigned int)_this);
+					v88 = v87;
+					v87->uY = v152 + v86;
+					v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
+					v90 = v88->uY;
+					v91 = v153;
+					v88->uHeight = v89;
+					v86 = v90 + v89 - 1;
+					v88->uW = v86;
+					v92 = v147;
+					if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
+						v92 = v148;
+					v144.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u);
+					v83 = pDialogueWindow;
+					++v153;
+					++v79;
+					_this = (Player *)((char *)_this + 1);
+					}
+					while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
+				}
+			return;
+		}
+		break;
+	case 95:  //buy spesial
+		{
+
+		pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
+
+		v11 = 0;
+		v61 = 0;
+		v153 = 0;
+		do
+			{
+			// if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+			if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID)
+				{
+				v62 = ItemsInShopTexture[v61];
+				if ( v61 >= 4 )
+					{
+					v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
+					pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
+					v126 = v61 + 1;
+					v66 = v153 + v67 + 80220;
+					}
+				else
+					{
+					v63 = 98 - v62->uTextureHeight;
+					v64 = ItemsInShopTexture[v61];
+					v65 = 98 - v62->uTextureHeight;
+					v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
+					pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
+					v126 = v61 + 1;
+					v66 = v152 + v153 + 640 * v63;
+					}
+				ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v126);
+				v11 = 0;
+				}
+			v153 += 105;
+			++v61;
+			}
+			while ( v61 < 8 );
+
+			if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+				return;
+			v68 = 0;
+			v149 = (__int32)v11;
+
+			do
+				{
+				// if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+				if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID)
+					++v149;
+				++v68;
+				}
+				while ( v68 < 6 );
+
+				v69 = GetAsyncKeyState(17);
+				v70 = _this->CanSteal();
+				Str = (char *)v70;
+				if ( v69 == (short)v11 || (char *)v70 == v11 )
+					{
+						v71 = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
+					}
+				else
+					{
+					v71 = pGlobalTXT_LocalizationStrings[185];
+					}
+				DrawTextAtStatusBar(v71, 0);
+				if ( (char *)v149 != v11 )
+					{
+					v73 = pMouse->GetCursorPos(&v136);
+					v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
+					if ( !v74 )
+						return;
+					v149 = v74 - 1;
+					v75 = (int)window_SpeakInHouse->ptr_1C;
+					v76 = 9 * (v74 - 1 + 12 * v75);
+					if ( dword_F8B19C == 2 )
+						v77 = (ItemGen *)&pParty->StandartItemsInShops[v76];
+					else
+						v77 = &pParty->SpecialItemsInShops[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
+					if ( v69 == (short)v11 || Str == v11 )
+						{
+						v124 = (__int64 *)v11;
+						v122 = 2;
+						v120 = window_SpeakInHouse->ptr_1C;
+						v116 = v77;
+						v78 = uActiveCharacter - 1;
+						v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
+						v14 = v78;
+						}
+					else
+						{
+						v124 = (__int64 *)v11;
+						v122 = 2;
+						v120 = window_SpeakInHouse->ptr_1C;
+						v116 = v77;
+						v15 = pGlobalTXT_LocalizationStrings[181];
+						v14 = uActiveCharacter - 1;
+						}
+					v36 = BuilDialogueString(v15, v14, v116, (char *)v120, v122, v124);
+					v123 = 3;
+					v121 = v36;
+					v119 = v148;
+					v117 = (int)v11;
+					v113 = (int)v11;
+					v111 = &v144;
+					v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
+					v112 = (unsigned int)v11;
+					v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
+					return;
+					}
+				v72 = window_SpeakInHouse->ptr_1C;
+				v144.DrawCurrentTime( pParty->field_3C.field_50[(int)v72]- pParty->uTimePlayed);
+				return;
+		}
+
+		break;
+	case 96:
+		if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+			return;
+		v152 = 0;
+		v37 = pDialogueWindow;
+		//v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
+		v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
+		_this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
+		if ( (signed int)_this < v38 / 3 )
+			_this = (Player *)(v38 / 3);
+		v39 = v37->pStartingPosActiveItem;
+		v40 = v37->pNumPresenceButton;
+		v153 = 0;
+		if ( (signed int)v39 < (signed int)(v39 + v40) )
+			{
+			do
+				{
+				v41 = v37->GetControl(v39)->uControlParam - 36;
+				if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v41] && !v0->pActiveSkills[v41] )
+					{
+					v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
+					v152 += v42;
+					++v153;
+					}
+				++v39;
+				}
+				while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
+				if ( v153 )
+					{
+					sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
+					v144.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+					_this = (Player *)((149 - v152) / v153);
+					if ( (149 - v152) / v153 > 32 )
+						_this = (Player *)32;
+					v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
+					v152 = v37->pStartingPosActiveItem;
+					v146 = v43;
+					if ( v152 < v152 + v37->pNumPresenceButton )
+						{
+						v153 = 2;
+						do
+							{
+							v44 = v37->GetControl(v152);
+							v45 = v44;
+							v46 = v44->uControlParam - 36;
+							if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v46] || v0->pActiveSkills[v46] )
+								{
+								v45->uW = 0;
+								v45->uHeight = 0;
+								v45->uY = 0;
+								}
+							else
+								{
+								v47 = pSkillNames[v46];
+								v45->uY = (unsigned int)((char *)_this + v146);
+								Str = v47;
+								v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
+								v49 = v45->uY;
+								v50 = v153;
+								v45->uHeight = v48;
+								v51 = v49 + v48 - 1;
+								v45->uW = v51;
+								v146 = v51;
+								v52 = v147;
+								if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
+									v52 = v148;
+								v144.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u);
+								}
+							v53 = v37->pStartingPosActiveItem;
+							++v152;
+							v54 = v37->pNumPresenceButton + v53;
+							++v153;
+							}
+							while ( v152 < v54 );
+						}
+					return;
+					}
+			}
+		sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);
+		strcat(pTmpBuf, "\n \n");
+		strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
+		v11 = 0;
+		v36 = pTmpBuf;
+		v123 = 3;
+		v121 = pTmpBuf;
+		v119 = v147;
+		v117 = 0;
+		v113 = 0;
+		v111 = &v144;
+		v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
+		v112 = (unsigned int)v11;
+		v144.DrawTitleText(pFontArrus, v112, v115, v119, v121, v123);
+		return;
+		break;
+
+		}
+
+	}
 
 //----- (004BB756) --------------------------------------------------------
 signed int __fastcall sub_4BB756(signed int a1)
@@ -3786,7 +3844,7 @@
                         pItemsTable->pItems[v33].pIconName,
                         TEXTURE_16BIT_PALETTE);
                 v8 = window_SpeakInHouse;
-                dword_F8B168[v32] = &pIcons_LOD->pTextures[v34];
+                ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
               }
               ++v32;
             }
@@ -4126,9 +4184,7 @@
     sub_421B2C_PlaceInInventory_or_DropPickedItem();
     return;
   }
-  if ( (signed __int64)__PAIR__(
-                         pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
-                         pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
+  if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
   {
     GenerateStandartShopItems();
     GenerateSpecialShopItems();
@@ -4158,7 +4214,7 @@
           v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
           //v3 = dword_F8B198;
           v8 = window_SpeakInHouse;
-          dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
+          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
         }
         v42 = v8->ptr_1C;
         ++v43;
@@ -4180,7 +4236,7 @@
           {
             v49 = rand();
             v8 = window_SpeakInHouse;
-            word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight);
+            word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
           }
           v47 = v8->ptr_1C;
           ++v48;
@@ -4197,13 +4253,13 @@
       do
       {
         //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
-	  v50=pParty->SpecialItemsInShop[(unsigned int)v42][(signed int)v43].uItemID;
+	  v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
         if ( v50 )
         {
           v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
           //v3 = dword_F8B198;
           v8 = window_SpeakInHouse;
-          dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
+          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
         }
         v42 = v8->ptr_1C;
         ++v43;
@@ -4221,11 +4277,11 @@
         do
         {
          // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
-		if (pParty->SpecialItemsInShop[(unsigned int)v52][v53].uItemID)
+		if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
           {
             v54 = rand();
             v8 = window_SpeakInHouse;
-            word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
+            word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
           }
           v52 = v8->ptr_1C;
           ++v53;
@@ -4539,8 +4595,8 @@
     }
     else
     {
-      _this =&pParty->SpecialItemsInShop[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724];
-      v32 = &pParty->SpecialItemsInShop[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
+      _this =&pParty->SpecialItemsInShops[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724];
+      v32 = &pParty->SpecialItemsInShops[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
     }
     //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
     v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;