changeset 440:4946b3ed74be

more itemgen
author Gloval
date Sun, 24 Feb 2013 16:11:51 +0400
parents 6b8118542175
children a812665688e4
files Game.cpp Party.h mm7_2.cpp mm7_4.cpp
diffstat 4 files changed, 48 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/Game.cpp	Sun Feb 24 14:51:43 2013 +0400
+++ b/Game.cpp	Sun Feb 24 16:11:51 2013 +0400
@@ -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.h	Sun Feb 24 14:51:43 2013 +0400
+++ b/Party.h	Sun Feb 24 16:11:51 2013 +0400
@@ -272,23 +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];
-  char field_C59v[2896];
-  ItemGen Recipes_Item[9][12];   //D0EC
-  char field_E01C[1216];
-  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];
--- a/mm7_2.cpp	Sun Feb 24 14:51:43 2013 +0400
+++ b/mm7_2.cpp	Sun Feb 24 16:11:51 2013 +0400
@@ -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];
@@ -1543,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;
       }
@@ -1583,8 +1584,8 @@
         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 = &pParty->Recipes_Item[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
         if ( !v56 || !Str )
@@ -2031,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;
@@ -2061,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;
@@ -2162,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;
         }
@@ -2206,8 +2210,8 @@
         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 = &pParty->Recipes_Item[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
         if ( !v63 || !Str )
@@ -2633,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 )
@@ -2704,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;
       }
@@ -4224,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);
@@ -4247,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;
@@ -4602,11 +4609,11 @@
     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
     {
--- a/mm7_4.cpp	Sun Feb 24 14:51:43 2013 +0400
+++ b/mm7_4.cpp	Sun Feb 24 16:11:51 2013 +0400
@@ -12210,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;
@@ -12242,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;
@@ -12343,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;
       }
@@ -12387,8 +12389,8 @@
       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 =&pParty->Recipes_Item[v72][v71];