diff mm7_6.cpp @ 222:8113753ed2ae

more item init fixing
author Gloval
date Sun, 17 Feb 2013 11:29:10 +0400
parents 9b77686e2239
children 1bd823f52e3a
line wrap: on
line diff
--- a/mm7_6.cpp	Sat Feb 16 18:46:59 2013 +0400
+++ b/mm7_6.cpp	Sun Feb 17 11:29:10 2013 +0400
@@ -5267,10 +5267,10 @@
                             {
                               v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
                               *(int *)(v245 + 4) = 0;
-                              for ( j = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                              for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                            + 1];
                                     ;
-                                    j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                                    j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                                                 + 1] )
                               {
                                 ++*(int *)(v245 + 4);
@@ -5354,9 +5354,9 @@
               {
                 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
                 *(int *)(v245 + 4) = 0;
-                for ( k = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
+                for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
                       ;
-                      k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                      k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                                   + 1] )
                 {
                   ++*(int *)(v245 + 4);
@@ -5368,19 +5368,19 @@
                 v256 = pItemsTable->field_116D8[18];
                 goto LABEL_611;
               }
-              v277 = pItemsTable->field_11798;
+              v277 = pItemsTable->pSpecialEnchantments_count;
               v278 = 0;
               v725 = 0.0;
               HIDWORD(v733) = 0;
-              if ( pItemsTable->field_11798 > 0 )
+              if ( pItemsTable->pSpecialEnchantments_count > 0 )
               {
                 v730 = (int)&v679;
                 do
                 {
-                  v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pName);
+                  v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement);
                   if ( !v279 || v279 == 1 )
                   {
-                    v280 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                    v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                         + 4]
                            + v278 * 28);
                     LODWORD(v725) += v280;
@@ -5399,7 +5399,7 @@
               v282 = rand() % SLODWORD(v725);
               v283 = v679;
               *(int *)(v245 + 12) = v679;
-              v284 = pItemsTable->pSpecialEnchantments[v283].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
+              v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
               v285 = v282 + 1;
               if ( v284 < v285 )
               {
@@ -5409,7 +5409,7 @@
                   v732 = v287;
                   v288 = *(int *)v287;
                   *(int *)(v245 + 12) = v288;
-                  v284 += pItemsTable->pSpecialEnchantments[v288].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                  v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                        + 4];
                   if ( v284 >= v285 )
                     break;
@@ -5452,9 +5452,9 @@
               {
                 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
                 *(int *)(v245 + 4) = 0;
-                for ( m = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
+                for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
                       ;
-                      m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                      m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                                   + 1] )
                 {
                   ++*(int *)(v245 + 4);
@@ -5466,19 +5466,19 @@
                 v256 = pItemsTable->field_116D8[20];
                 goto LABEL_611;
               }
-              v257 = pItemsTable->field_11798;
+              v257 = pItemsTable->pSpecialEnchantments_count;
               v258 = 0;
               v725 = 0.0;
               HIDWORD(v733) = 0;
-              if ( pItemsTable->field_11798 > 0 )
+              if ( pItemsTable->pSpecialEnchantments_count > 0 )
               {
                 v730 = (int)&v679;
                 do
                 {
-                  v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pName);
+                  v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
                   if ( !v259 || v259 == 1 )
                   {
-                    v260 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                    v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                         + 4]
                            + v258 * 28);
                     LODWORD(v725) += v260;
@@ -5497,7 +5497,7 @@
               v262 = rand() % SLODWORD(v725);
               v263 = v679;
               *(int *)(v245 + 12) = v679;
-              v264 = pItemsTable->pSpecialEnchantments[v263].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
+              v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
               v265 = v262 + 1;
               if ( v264 < v265 )
               {
@@ -5507,7 +5507,7 @@
                   v732 = v267;
                   v268 = *(int *)v267;
                   *(int *)(v245 + 12) = v268;
-                  v264 += pItemsTable->pSpecialEnchantments[v268].field_8[pItemsTable->pItems[*(int *)v245].uEquipType
+                  v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
                                                                        + 4];
                   if ( v264 >= v265 )
                     break;
@@ -5550,20 +5550,20 @@
         }
         if ( rand() % 100 >= 80 )
         {
-          v297 = pItemsTable->field_11798;
+          v297 = pItemsTable->pSpecialEnchantments_count;
           v294 = _this;
           v298 = 0;
           v725 = 0.0;
           HIDWORD(v733) = 0;
-          if ( pItemsTable->field_11798 > 0 )
+          if ( pItemsTable->pSpecialEnchantments_count > 0 )
           {
             v730 = (int)&v679;
             do
             {
-              v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pName);
+              v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement);
               if ( !v299 || v299 == 1 )
               {
-                v300 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]
+                v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]
                        + v298 * 28);
                 LODWORD(v725) += v300;
                 if ( v300 )
@@ -5581,7 +5581,7 @@
           v302 = rand() % SLODWORD(v725);
           v303 = v679;
           v294->uAdditionalValue = v679;
-          v304 = pItemsTable->pSpecialEnchantments[v303].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
+          v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
           v305 = v302 + 1;
           if ( v304 < v305 )
           {
@@ -5591,7 +5591,7 @@
               v732 = v307;
               v308 = *(int *)v307;
               v294->uAdditionalValue = v308;
-              v304 += pItemsTable->pSpecialEnchantments[v308].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
+              v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
               if ( v304 >= v305 )
                 break;
             }
@@ -5604,9 +5604,9 @@
           v294 = _this;
           v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
           _this->_bonus_type = 0;
-          for ( kk = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
+          for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
                 ;
-                kk += pItemsTable->pEnchantments[v294->_bonus_type].field_8[pItemsTable->pItems[v294->uItemID].uEquipType
+                kk += pItemsTable->pEnchantments[v294->_bonus_type].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
                                                                          + 1] )
           {
             ++v294->_bonus_type;
@@ -8575,14 +8575,14 @@
   if ( !(a1a.uAttributes & 0x10) )
   {
     v13 = 0;
-    if ( (signed int)pItemsTable->pItems[0].uItemID > 0 )
+    if ( (signed int)pItemsTable->uAllItemsCount > 0 )
     {
       v14 = (char *)&pItemsTable->pItems[0].uSpriteID;
       while ( *(short *)v14 != v9 )
       {
         ++v13;
         v14 += 48;
-        if ( (signed int)v13 >= (signed int)pItemsTable->pItems[0].uItemID )
+        if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount )
           goto LABEL_16;
       }
       a1a.stru_24.uItemID = v13;