changeset 442:a812665688e4

Merge
author Nomad
date Sun, 24 Feb 2013 15:22:03 +0200
parents acd8fa960c32 (current diff) 4946b3ed74be (diff)
children c0ab5f64b37b 197461e5acec
files mm7_2.cpp
diffstat 7 files changed, 106 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/Game.cpp	Sun Feb 24 15:21:24 2013 +0200
+++ b/Game.cpp	Sun Feb 24 15:22:03 2013 +0200
@@ -417,16 +417,18 @@
         pTurnEngine->End(1);
         pParty->bTurnBasedModeOn = 0;
       }
-      pHealth = &pParty->pPlayers[0].sHealth;//193C
-      do
+      //pHealth = &pParty->pPlayers[0].sHealth;//193C
+      //do
+	  for(int i=0; i<4; ++i)
       {
-        memset(pHealth - 0x64F, 0, 0xA0u);//(pConditions, 0, 160)
-        memset(pHealth - 0x67, 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
-        *pHealth = 1;
-        pHealth += 1743; //6CF
+        memset(pParty->pPlayers[i].pConditions, 0, 0xA0u);//(pConditions, 0, 160)
+        memset(pParty->pPlayers[i].pPlayerBuffs, 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
+        //*pHealth = 1;
+		pParty->pPlayers[i].sHealth=1;
+        //pHealth += 1743; //6CF
         uActiveCharacter = 1;
       }
-      while ( (signed int)pHealth < (signed int)&pParty->field_871C[567] );
+    //  while ( (signed int)pHealth < (signed int)&pParty->field_871C[567] );
       if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 136) )
       {
         pParty->vPosition.x = -17331;            // respawn in harmondale
--- a/Party.cpp	Sun Feb 24 15:21:24 2013 +0200
+++ b/Party.cpp	Sun Feb 24 15:22:03 2013 +0200
@@ -398,7 +398,7 @@
     Dst.Reset();
     if ( bGiveItems )
     {
-      pItemsTable->GenerateItem(2, 40, &Dst);
+      pItemsTable->GenerateItem(2, 40, &Dst); //ring
       pCharacter->AddItem2(-1, &Dst);
       //uSkillIdx = 0;
       //v18 = 0;
--- a/Party.h	Sun Feb 24 15:21:24 2013 +0200
+++ b/Party.h	Sun Feb 24 15:22:03 2013 +0200
@@ -272,22 +272,9 @@
   NPCData pHirelings[2];
   ItemGen pPickedItem;
   unsigned int uFlags;
-  int field_777C[1000];
-  int field_871C[1000];
-  int field_96BC[1000];
-  int field_A65C[1000];
-  int field_B5FC[1000];
-  int field_C59C[1000];
-  int field_D53C[1000];
-  int field_E4DC[300];
-  int field_E98C[13];
-  int dword_E9C0;
-  int dword_E9C4;
-  char field_E9C8[5000];
-  char field_FD50[5000];
-  char field_110D8[5000];
-  char field_12460[5000];
-  char field_137E8[5000];
+  ItemGen field_777C[53][12];
+  ItemGen Recipes_Item[53][12];   //D0EC
+  int field_12A5C[2117];
   char field_14B70[5000];
   char field_15EF8[250];
   char field_15FF2[130];
@@ -296,7 +283,7 @@
   int armageddon_timer;
   int field_16140;
   int pTurnBasedPlayerRecoveryTimes[4];
-  char field_16154[212];
+  int field_16154[53];
   int uFine;
   float flt_TorchlightColorR;
   float flt_TorchlightColorG;
--- a/mm7_2.cpp	Sun Feb 24 15:21:24 2013 +0200
+++ b/mm7_2.cpp	Sun Feb 24 15:22:03 2013 +0200
@@ -961,7 +961,7 @@
       if ( v2 <= 41 )
       {
         v4 = word_4F0576[v2];
-        v9 = 22;
+        v9 = 22;  //misc
         goto LABEL_12;
       }
       if ( v2 <= 53 )
@@ -969,19 +969,19 @@
         if ( v1 >= 6 )
         {
           v4 = word_4F0578[v2];
-          v9 = 45;
+          v9 = 45;  //reagent
 LABEL_12:
           v5 = v9;
 LABEL_13:
-          pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]);
+          pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[v2][v1]);//9 * (v1 + 12 * v2)]);
           v0 = window_SpeakInHouse;
-          pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 5] = 1;
+          pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes = 1;  //identified
           goto LABEL_14;
         }
-        auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)];
+        auto _t = (ItemGen *)&pParty->field_777C[v2][v1];
         _t->Reset();
         v0 = window_SpeakInHouse;
-        pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] = 220;
+        pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uItemID = 220;  //potion bottle
       }
 LABEL_14:
       v2 = (signed int)v0->ptr_1C;
@@ -1491,7 +1491,8 @@
     v109 = 0;
     do
     {
-      if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
+    //  if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
+	if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID);
       {
         v49 = word_F8B158[(signed int)v48];
         v50 = dword_F8B168[(signed int)v48];
@@ -1516,7 +1517,8 @@
     v108 = 0;
     do
     {
-      if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
+   //   if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
+	if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
       {
         v52 = word_F8B158[(signed int)v109] + 30;
         v53 = dword_F8B168[(signed int)v109];
@@ -1542,7 +1544,7 @@
       v106.x = 0;
       do
       {
-        if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+        if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
           ++v106.x;
         ++v55;
       }
@@ -1552,7 +1554,8 @@
     {
       do
       {
-        if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+       // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
           ++v106.x;
         ++v55;
       }
@@ -1581,10 +1584,10 @@
         v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
         v106.x = v60;
         v61 = (int)window_SpeakInHouse->ptr_1C;
-        v62 = 9 * (v60 + 12 * v61);
-        v63 = (ItemGen *)&pParty->field_777C[v62];
+      //  v62 = 9 * (v60 + 12 * v61);
+        v63 = (ItemGen *)&pParty->field_777C[(int)v61][v60];
         if ( dword_F8B19C != 2 )
-          v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
+          v63 = &pParty->Recipes_Item[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
         if ( !v56 || !Str )
         {
           v85 = 0;
@@ -2029,7 +2032,8 @@
     {
       do
       {
-        if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+       // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+	  if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
         {
           v46 = dword_F8B168[v114];
           v47 = 152 - v46->uTextureHeight;
@@ -2059,7 +2063,8 @@
       v114 = 0;
       do
       {
-        if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
+      //  if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
+	  if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
         {
           v50 = dword_F8B168[v114 + 6];
           v51 = 308 - v50->uTextureHeight;
@@ -2091,7 +2096,8 @@
     {
       do
       {
-        if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+        //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
         {
           v54 = dword_F8B168[v114];
           v55 = 152 - v54->uTextureHeight;
@@ -2121,7 +2127,8 @@
       v114 = 0;
       do
       {
-        if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )
+       // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )   //weak 
+	     if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
         {
           v58 = dword_F8B168[v114 + 6];
           v59 = 308 - v58->uTextureHeight;
@@ -2158,7 +2165,8 @@
       {
         do
         {
-          if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+         // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+		if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID);
             ++v109;
           ++v62;
         }
@@ -2168,7 +2176,8 @@
       {
         do
         {
-          if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+          //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+		if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
             ++v109;
           ++v62;
         }
@@ -2201,10 +2210,10 @@
         v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
         v109 = v67;
         v68 = (int)window_SpeakInHouse->ptr_1C;
-        v69 = 9 * (v67 + 12 * v68);
-        v70 = (ItemGen *)&pParty->field_777C[v69];
+      //  v69 = 9 * (v67 + 12 * v68);
+        v70 = (ItemGen *)&pParty->field_777C[v68][v67];
         if ( dword_F8B19C != 2 )
-          v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
+          v70 = &pParty->Recipes_Item[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
         if ( !v63 || !Str )
         {
           v93 = 0;
@@ -2408,7 +2417,8 @@
       v93 = 0;
       do
       {
-        if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+       // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID)
           ++v149;
         ++v93;
       }
@@ -2423,9 +2433,9 @@
           --v149;
           v96 = window_SpeakInHouse->ptr_1C;
           v97 = uActiveCharacter - 1;
-          v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
+       //   v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
           v99 = _this->_490EEE(
-                  (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
+                 &pParty->Recipes_Item[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
                   2,
                   (int)window_SpeakInHouse->ptr_1C,
                   2);
@@ -2439,7 +2449,8 @@
         v153 = 0;
         do
         {
-          if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+          //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+		if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID)
           {
             v105 = dword_F8B168[v104];
             if ( v104 >= 4 )
@@ -2626,7 +2637,8 @@
       v153 = 0;
       do
       {
-        if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+      //  if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+	  if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);
         {
           v56 = dword_F8B168[v55];
           if ( v55 >= 4 )
@@ -2660,7 +2672,8 @@
       v153 = 0;
       do
       {
-        if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+       // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID)
         {
           v62 = dword_F8B168[v61];
           if ( v61 >= 4 )
@@ -2696,7 +2709,8 @@
     {
       do
       {
-        if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 )
+       // if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 )
+	  if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v68].uItemID);
           ++v149;
         ++v68;
       }
@@ -2706,7 +2720,8 @@
     {
       do
       {
-        if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+       // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
+	  if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID)
           ++v149;
         ++v68;
       }
@@ -2738,7 +2753,7 @@
       if ( dword_F8B19C == 2 )
         v77 = (ItemGen *)&pParty->field_777C[v76];
       else
-        v77 = (ItemGen *)&pParty->field_C59C[v76 + 724];
+        v77 = &pParty->Recipes_Item[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
       if ( v69 == (short)v11 || Str == v11 )
       {
         v124 = (__int64 *)v11;
@@ -4215,7 +4230,7 @@
     {
       do
       {
-        v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)];
+        v45 = pParty->field_777C[(int)v42][v43].uItemID;
         if ( v45 )
         {
           v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
@@ -4238,7 +4253,8 @@
       {
         do
         {
-          if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
+         // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
+		 if ( pParty->field_777C[(int)v47][v48].uItemID);
           {
             v49 = rand();
             v8 = window_SpeakInHouse;
@@ -4258,7 +4274,8 @@
     {
       do
       {
-        v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
+        //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
+	  v50=pParty->Recipes_Item[(unsigned int)v42][(signed int)v43].uItemID;
         if ( v50 )
         {
           v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
@@ -4281,7 +4298,8 @@
       {
         do
         {
-          if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
+         // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
+		if (pParty->Recipes_Item[(unsigned int)v52][v53].uItemID)
           {
             v54 = rand();
             v8 = window_SpeakInHouse;
@@ -4591,16 +4609,16 @@
     if ( !v29 )
       return;
     v30 = window_SpeakInHouse->ptr_1C;
-    v31 = 9 * (v29 - 1 + 12 * (int)v30);
+   // v31 = 9 * (v29 - 1 + 12 * (int)v30);
     if ( dword_F8B19C == 2 )
     {
-      v32 = (ItemGen *)&pParty->field_777C[v31];
-      _this = (ItemGen *)&pParty->field_777C[v31];
+      v32 = (ItemGen *)&pParty->field_777C[(int)v30][v29];
+      _this = (ItemGen *)&pParty->field_777C[(int)v30][v29];
     }
     else
     {
-      _this = (ItemGen *)&pParty->field_C59C[v31 + 724];
-      v32 = (ItemGen *)&pParty->field_C59C[v31 + 724];
+      _this =&pParty->Recipes_Item[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724];
+      v32 = &pParty->Recipes_Item[(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;
--- a/mm7_4.cpp	Sun Feb 24 15:21:24 2013 +0200
+++ b/mm7_4.cpp	Sun Feb 24 15:22:03 2013 +0200
@@ -4915,7 +4915,7 @@
   NPCData *npc = nullptr;
   if ( dword_5C35D4 )
   {
-    __debugbreak(); // fix
+    __debugbreak(); // fix  
     npc = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
   }
   else
@@ -9112,7 +9112,8 @@
     v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
     v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
     if ( dword_F8B19C != 2 )
-      v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
+   //   v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
+		v7 =&pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
     goto LABEL_15;
   }
   if ( dword_F8B198 <= 16 && dword_F8B19C == 18 )
@@ -12209,7 +12210,8 @@
   {
     do
     {
-      if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+     // 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);
       {
         v50 = dword_F8B168[v49];
         v51 = 152 - v50->uTextureHeight;
@@ -12241,7 +12243,8 @@
     v122 = 0;
     do
     {
-      if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
+      //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);
       {
         v54 = dword_F8B168[v122 + 6];
         v55 = 306 - v54->uTextureHeight;
@@ -12271,7 +12274,8 @@
   {
     do
     {
-      if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+     // 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)
       {
         v58 = dword_F8B168[v49];
         v59 = 152 - v58->uTextureHeight;
@@ -12303,7 +12307,8 @@
     v122 = 0;
     do
     {
-      if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )
+      //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)
       {
         v62 = dword_F8B168[v122 + 6];
         v63 = 306 - v62->uTextureHeight;
@@ -12340,7 +12345,7 @@
     {
       do
       {
-        if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
+        if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
           ++v117;
         ++v66;
       }
@@ -12350,7 +12355,8 @@
     {
       do
       {
-        if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
+        //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)
           ++v117;
         ++v66;
       }
@@ -12383,10 +12389,11 @@
       v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
       v117 = v71;
       v72 = (int)window_SpeakInHouse->ptr_1C;
-      v73 = 9 * (v71 + 12 * v72);
-      v74 = (ItemGen *)&pParty->field_777C[v73];
+     // v73 = 9 * (v71 + 12 * v72);
+      v74 = (ItemGen *)&pParty->field_777C[v72][v71];
       if ( dword_F8B19C != 2 )
-        v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
+       // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
+	      v74 =&pParty->Recipes_Item[v72][v71];
       if ( v67 && Str )
       {
         v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
@@ -13483,7 +13490,7 @@
 
 
 //----- (004B8F94) --------------------------------------------------------
-void *__cdecl sub_4B8F94()
+void  sub_4B8F94()
 {
   GUIWindow *v0; // edi@1
   signed int v1; // ebp@1
@@ -13533,18 +13540,21 @@
 LABEL_12:
           v6 = v12;
 LABEL_13:
-          pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
+          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->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 = (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;
+	//	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;
@@ -13561,8 +13571,7 @@
   }
 LABEL_15:
   result = v0->ptr_1C;
-  *(int *)&pParty->field_16154[4 * (int)result] = 0;
-  return result;
+  pParty->field_16154[(int)v0->ptr_1C] = 0;
 }
 
 
--- a/mm7_data.cpp	Sun Feb 24 15:21:24 2013 +0200
+++ b/mm7_data.cpp	Sun Feb 24 15:22:03 2013 +0200
@@ -1660,7 +1660,9 @@
 
 __int16 word_4F0578[777]; // weak
 __int16 word_4F05AE[777]; // weak
-char _4F063C_smthn_by_2da_uType[777]; // weak
+char _4F063C_smthn_by_2da_uType[31]={ // weak
+0, 6, 8, 12, 12, 0, 0, 0, 0, 0, 0, 0, 2, 0, 25, 0, 30,
+0, 20, 0, 20, 0, 2, 0, 23, 0, 24, 0, 28, 0, 20};
 __int16 word_4F063E[290];
 __int16 word_4F06D8[22];
 __int16 word_4F0704[40];
--- a/mm7_data.h	Sun Feb 24 15:21:24 2013 +0200
+++ b/mm7_data.h	Sun Feb 24 15:22:03 2013 +0200
@@ -2330,7 +2330,7 @@
 void __cdecl _4B7D7E_bank();
 void __cdecl TavernDialog();
 void *__cdecl GenerateShopItems();
-void *__cdecl sub_4B8F94();
+void sub_4B8F94();
 char *__cdecl WeaponShopDialog();
 POINT *__cdecl AlchemistDialog();
 void __cdecl ArmorShopDialog();