diff mm7_4.cpp @ 468:8822405efad2

Слияние
author Ritor1
date Mon, 25 Feb 2013 11:10:57 +0600
parents 5d2667144526 e9f40d344067
children 0dbf780e247f
line wrap: on
line diff
--- a/mm7_4.cpp	Mon Feb 25 11:09:55 2013 +0600
+++ b/mm7_4.cpp	Mon Feb 25 11:10:57 2013 +0600
@@ -4915,7 +4915,7 @@
   NPCData *npc = nullptr;
   if ( dword_5C35D4 )
   {
-    __debugbreak(); // fix  
+    //__debugbreak(); // fix  
     npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)];
   }
   else
@@ -8922,7 +8922,7 @@
   pParty->field_3C._shop_ban_times[2 * a1] = LODWORD(pParty->uTimePlayed) + 368640;
   pParty->field_3C._shop_ban_times[2 * a1 + 1] = HIDWORD(v6);
 LABEL_13:
-  *(int *)&pParty->field_16154[4 * a1] = 1;
+  pParty->InTheShopFlags[a1] = 1;
   if ( v3 )
   {
     v7 = &pOutdoor->ddm;
@@ -9055,7 +9055,7 @@
 // F8B1E0: using guessed type int dword_F8B1E0;
 
 
-
+//view  item details  in shop?
 //----- (004B1A2D) --------------------------------------------------------
 void __cdecl sub_4B1A2D()
 {
@@ -9113,7 +9113,7 @@
     v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
     if ( dword_F8B19C != 2 )
    //   v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
-		v7 =&pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
+		v7 =&pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
     goto LABEL_15;
   }
   if ( dword_F8B198 <= 16 && dword_F8B19C == 18 )
@@ -10365,385 +10365,6 @@
            0);
 }
 
-//----- (004B3703) --------------------------------------------------------
-int __thiscall sub_4B3703(void *_this)
-{
-  signed int v1; // edi@1
-  int v2; // eax@1
-  char *v3; // ecx@1
-  signed int v4; // ebx@1
-  int v5; // ecx@2
-  int v6; // ecx@3
-  int v7; // ecx@4
-  int v8; // ecx@5
-  int v9; // ecx@6
-  signed int v10; // ebx@13
-  signed int v11; // edi@14
-  signed int v12; // esi@15
-  unsigned int v13; // ecx@16
-  int v14; // ecx@16
-  int v15; // ecx@17
-  int v16; // ecx@19
-  int v17; // ecx@20
-  int v18; // ecx@21
-  signed int v19; // esi@32
-  char *v20; // ecx@33
-  int v21; // ecx@34
-  int v22; // ecx@36
-  int v23; // ecx@37
-  int v24; // ecx@38
-  int v25; // ecx@39
-  int v26; // ecx@40
-  int v27; // ecx@41
-  int *v28; // esi@54
-  unsigned int v29; // edx@56
-  char *v30; // ecx@65
-  int v31; // ecx@106
-  int result; // eax@107
-  int v33; // [sp-4h] [bp-2Ch]@23
-  int v34; // [sp-4h] [bp-2Ch]@43
-  int v35[5]; // [sp+Ch] [bp-1Ch]@8
-  int a2; // [sp+20h] [bp-8h]@1
-  int v37; // [sp+24h] [bp-4h]@1
-
-  v1 = 0;
-  v2 = 0;
-  v3 = (char *)_this - 1;
-  a2 = 0;
-  v37 = 0;
-  dword_F8B1DC = 0;
-  v4 = 2;
-  if ( !v3 )
-  {
-    while ( 1 )
-    {
-      v19 = 1;
-      do
-      {
-        v20 = (char *)window_SpeakInHouse->ptr_1C + 4 * (unsigned int)window_SpeakInHouse->ptr_1C + v19;
-        if ( v1 )
-          v21 = word_4F063E[(signed int)v20];
-        else
-          v21 = word_4F0404[(signed int)v20 - 4];//word_4F03FE[(signed int)v20];
-        v22 = v21 - 23;
-        if ( v22 )
-        {
-          v23 = v22 - 1;
-          if ( v23 )
-          {
-            v24 = v23 - 1;
-            if ( v24 )
-            {
-              v25 = v24 - 1;
-              if ( v25 )
-              {
-                v26 = v25 - 1;
-                if ( v26 )
-                {
-                  v27 = v26 - 1;
-                  if ( v27 )
-                  {
-                    if ( v27 != v4 )
-                      goto LABEL_51;
-                    v34 = 36;
-                  }
-                  else
-                  {
-                    v34 = 42;
-                  }
-                }
-                else
-                {
-                  v34 = 41;
-                }
-              }
-              else
-              {
-                v34 = 40;
-              }
-            }
-            else
-            {
-              v34 = 39;
-            }
-          }
-          else
-          {
-            v34 = 38;
-          }
-        }
-        else
-        {
-          v34 = 37;
-        }
-        v37 = sub_4BE571(v34, v35, v37, 5);
-        v2 = dword_F8B1DC;
-        v4 = 2;
-LABEL_51:
-        ++v19;
-      }
-      while ( v19 <= 4 );
-      ++v1;
-      if ( v1 >= v4 )
-        goto LABEL_53;
-    }
-  }
-  v5 = (int)(v3 - 1);
-  if ( !v5 )
-  {
-    v10 = 0;
-    while ( 1 )
-    {
-      v11 = 0;
-      do
-      {
-        v12 = 1;
-        do
-        {
-          v13 = v11 + 2 * (unsigned int)window_SpeakInHouse->ptr_1C - 30;
-          v14 = v12 + 4 * v13 + v13;
-          if ( v10 )
-            v15 = word_4F06D8[v14];
-          else
-            v15 = word_4F0498[v14];
-          v16 = v15 - 31;
-          if ( v16 )
-          {
-            v17 = v16 - 1;
-            if ( v17 )
-            {
-              v18 = v17 - 1;
-              if ( v18 )
-              {
-                if ( v18 != 1 )
-                  goto LABEL_28;
-                v33 = 44;
-              }
-              else
-              {
-                v33 = 47;
-              }
-            }
-            else
-            {
-              v33 = 46;
-            }
-          }
-          else
-          {
-            v33 = 45;
-          }
-          v37 = sub_4BE571(v33, v35, v37, 5);
-          v2 = dword_F8B1DC;
-LABEL_28:
-          ++v12;
-        }
-        while ( v12 <= 4 );
-        ++v11;
-      }
-      while ( v11 < 2 );
-      ++v10;
-      if ( v10 >= 2 )
-        goto LABEL_53;
-    }
-  }
-  v6 = v5 - 1;
-  if ( v6 )
-  {
-    v7 = v6 - 1;
-    if ( v7 )
-    {
-      v8 = v7 - 17;
-      if ( v8 )
-      {
-        v9 = v8 - 2;
-        if ( v9 )
-        {
-          if ( v9 == 7 )
-          {
-            v37 = 2;
-            v35[0] = 69;
-            v35[1] = 60;
-          }
-        }
-        else
-        {
-          v37 = 3;
-          v35[0] = 67;
-          v35[1] = 66;
-          v35[2] = 58;
-        }
-      }
-      else
-      {
-        v37 = 3;
-        v35[0] = 70;
-        v35[1] = 65;
-        v35[2] = 62;
-      }
-    }
-    else
-    {
-      v37 = 2;
-      v35[0] = 71;
-      v35[1] = 68;
-    }
-  }
-  else
-  {
-    v37 = 2;
-    v35[0] = 57;
-    v35[1] = 59;
-  }
-LABEL_53:
-  if ( v37 > 0 )
-  {
-    v28 = v35;
-    while ( 1 )
-    {
-      v29 = *v28;
-      if ( *v28 <= 47 )
-        break;
-      if ( (signed int)v29 <= 66 )
-      {
-        if ( v29 == 66 )
-        {
-          v30 = pSkillNames[30];
-          goto LABEL_106;
-        }
-        if ( v29 == 57 )
-        {
-          v30 = pSkillNames[21];
-          goto LABEL_106;
-        }
-        if ( v29 == 58 )
-        {
-          v30 = pSkillNames[22];
-          goto LABEL_106;
-        }
-        if ( v29 == 60 )
-        {
-          v30 = pSkillNames[24];
-          goto LABEL_106;
-        }
-        if ( v29 == 62 )
-        {
-          v30 = pSkillNames[26];
-          goto LABEL_106;
-        }
-        if ( v29 == 65 )
-        {
-          v30 = pSkillNames[29];
-          goto LABEL_106;
-        }
-        goto LABEL_100;
-      }
-      switch ( v29 )
-      {
-        case 0x43u:
-          v30 = pSkillNames[31];
-          break;
-        case 0x44u:
-          v30 = pSkillNames[32];
-          break;
-        case 0x45u:
-          v30 = pSkillNames[33];
-          break;
-        case 0x46u:
-          v30 = pSkillNames[34];
-          break;
-        default:
-          if ( v29 != 71 )
-            goto LABEL_100;
-          v30 = pSkillNames[35];
-          break;
-      }
-LABEL_106:
-      pShopOptions[v2] = v30;
-      v31 = a2++;
-      dword_F8B1DC = v2 + 1;
-      sub_4B36CC(v31, v29);
-      ++v28;
-      if ( a2 >= v37 )
-        goto LABEL_107;
-      v2 = dword_F8B1DC;
-    }
-    if ( *v28 == 47 )
-    {
-      v30 = pSkillNames[11];
-      goto LABEL_106;
-    }
-    if ( (signed int)v29 > 40 )
-    {
-      if ( v29 == 41 )
-      {
-        v30 = pSkillNames[5];
-        goto LABEL_106;
-      }
-      if ( v29 == 42 )
-      {
-        v30 = pSkillNames[6];
-        goto LABEL_106;
-      }
-      if ( v29 == 44 )
-      {
-        v30 = pSkillNames[8];
-        goto LABEL_106;
-      }
-      if ( v29 == 45 )
-      {
-        v30 = pSkillNames[9];
-        goto LABEL_106;
-      }
-      if ( v29 == 46 )
-      {
-        v30 = pSkillNames[10];
-        goto LABEL_106;
-      }
-    }
-    else
-    {
-      if ( v29 == 40 )
-      {
-        v30 = pSkillNames[4];
-        goto LABEL_106;
-      }
-      if ( v29 == 5 )
-      {
-        v30 = pSkillNames[23];
-        goto LABEL_106;
-      }
-      if ( v29 == 36 )
-      {
-        v30 = pSkillNames[0];
-        goto LABEL_106;
-      }
-      if ( v29 == 37 )
-      {
-        v30 = pSkillNames[1];
-        goto LABEL_106;
-      }
-      if ( v29 == 38 )
-      {
-        v30 = pSkillNames[2];
-        goto LABEL_106;
-      }
-      if ( v29 == 39 )
-      {
-        v30 = pSkillNames[3];
-        goto LABEL_106;
-      }
-    }
-LABEL_100:
-    v30 = pGlobalTXT_LocalizationStrings[127];
-    goto LABEL_106;
-  }
-LABEL_107:
-  pDialogueWindow->_41D08F(a2, 1, 0, 2);
-  result = pDialogueWindow->pNumPresenceButton;
-  dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
-  return result;
-}
 
 
 //----- (004B3A72) --------------------------------------------------------
@@ -12161,7 +11782,7 @@
     do
     {
      // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
-	 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID);
+	 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID);
       {
         v50 = dword_F8B168[v49];
         v51 = 152 - v50->uTextureHeight;
@@ -12194,7 +11815,7 @@
     do
     {
       //if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
-	if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v122+1].uItemID);
+	if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122+1].uItemID);
       {
         v54 = dword_F8B168[v122 + 6];
         v55 = 306 - v54->uTextureHeight;
@@ -12225,7 +11846,7 @@
     do
     {
      // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-	if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
+	if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
       {
         v58 = dword_F8B168[v49];
         v59 = 152 - v58->uTextureHeight;
@@ -12258,7 +11879,7 @@
     do
     {
       //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] )  //weak
-		if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
+		if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
       {
         v62 = dword_F8B168[v122 + 6];
         v63 = 306 - v62->uTextureHeight;
@@ -12295,7 +11916,7 @@
     {
       do
       {
-        if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+        if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
           ++v117;
         ++v66;
       }
@@ -12306,7 +11927,7 @@
       do
       {
         //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
-	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
+	  if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
           ++v117;
         ++v66;
       }
@@ -12340,10 +11961,10 @@
       v117 = v71;
       v72 = (int)window_SpeakInHouse->ptr_1C;
      // v73 = 9 * (v71 + 12 * v72);
-      v74 = (ItemGen *)&pParty->field_777C[v72][v71];
+      v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71];
       if ( dword_F8B19C != 2 )
        // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
-	      v74 =&pParty->Recipes_Item[v72][v71];
+	      v74 =&pParty->SpecialItemsInShop[v72][v71];
       if ( v67 && Str )
       {
         v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
@@ -13439,92 +13060,6 @@
 
 
 
-//----- (004B8F94) --------------------------------------------------------
-void  sub_4B8F94()
-{
-  GUIWindow *v0; // edi@1
-  signed int v1; // ebp@1
-  int v2; // ebx@1
-  signed int v3; // esi@1
-  int v4; // eax@3
-  int v5; // ebx@3
-  int v6; // ecx@3
-  bool v7; // eax@5
-  bool v8; // ST1C_4@5
-  int v9; // eax@5
-  int v10; // eax@10
-  void *result; // eax@15
-  signed int v12; // [sp-4h] [bp-18h]@7
-
-  v0 = window_SpeakInHouse;
-  v1 = 0;
-  v2 = (int)&window_SpeakInHouse->ptr_1C;
-  v3 = (signed int)window_SpeakInHouse->ptr_1C;
-  //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
-  if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
-  {
-    while ( v3 > 14 )
-    {
-      if ( v3 <= 28 )
-      {
-        v7 = v1 > 3;
-        v8 = v7;
-        v9 = 5 * (v7 + 2 * v3 - 30);
-        v3 = (signed int)v0->ptr_1C;
-        v5 = word_4F06D8[v9];
-        v6 = word_4F05AE[5 * (v8 + 2 * v3) + rand() % 4];
-        goto LABEL_13;
-      }
-      if ( v3 <= 41 )
-      {
-        v5 = word_4F07B6[v3];
-        v12 = 22;
-        goto LABEL_12;
-      }
-      if ( v3 <= 53 )
-      {
-        if ( v1 >= 6 )
-        {
-          v5 = word_4F07B6[v3 + 1];
-          v12 = 44;
-LABEL_12:
-          v6 = v12;
-LABEL_13:
-          pItemsTable->GenerateItem(v5, v6,&pParty->Recipes_Item[v3][v1]);//(ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
-          v0 = window_SpeakInHouse;
-          v2 = (int)&window_SpeakInHouse->ptr_1C;
-         // pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1;
-		  pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes= 1;
-          goto LABEL_14;
-        }
-       // auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
-		 auto _a =&pParty->Recipes_Item[v3][v1];
-        _a->Reset();
-	//	v2 = (int)&v0->ptr_1C;
-		//v10 = rand();
-	//	v0 = window_SpeakInHouse;
-       // pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
-		   pParty->Recipes_Item[(int)v0->ptr_1C][v1].uItemID= rand() % 32 + 740;
-      }
-LABEL_14:
-      v3 = *(int *)v2;
-      ++v1;
-      //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] )
-      if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[*(int *)v2 - 1].uType] )
-        goto LABEL_15;
-    }
-    v4 = 5 * v3;
-    v3 = (signed int)v0->ptr_1C;
-    v5 = word_4F063E[v4];
-    v6 = word_4F063E[5 * v3 + rand() % 4 + 1];
-    goto LABEL_13;
-  }
-LABEL_15:
-  result = v0->ptr_1C;
-  pParty->field_16154[(int)v0->ptr_1C] = 0;
-}
-
-
 //----- (004B6478) --------------------------------------------------------
 int __cdecl sub_4B6478()
 {