diff mm7_4.cpp @ 439:6b8118542175

recipie item
author Gloval
date Sun, 24 Feb 2013 14:51:43 +0400
parents 0a1ea44b4a0a
children 4946b3ed74be
line wrap: on
line diff
--- a/mm7_4.cpp	Sun Feb 24 09:52:29 2013 +0200
+++ b/mm7_4.cpp	Sun Feb 24 14:51:43 2013 +0400
@@ -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 )
@@ -12271,7 +12272,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 +12305,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;
@@ -12350,7 +12353,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;
       }
@@ -12386,7 +12390,8 @@
       v73 = 9 * (v71 + 12 * v72);
       v74 = (ItemGen *)&pParty->field_777C[v73];
       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 +13488,7 @@
 
 
 //----- (004B8F94) --------------------------------------------------------
-void *__cdecl sub_4B8F94()
+void  sub_4B8F94()
 {
   GUIWindow *v0; // edi@1
   signed int v1; // ebp@1
@@ -13533,18 +13538,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 +13569,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;
 }