changeset 570:f54481c85df8

itemgen working, i hope
author Gloval
date Wed, 06 Mar 2013 00:09:49 +0400
parents f451efdb7c8b
children 0455b0405c17 f8a4a2e0b4c9
files Indoor.cpp Items.cpp Items.h NPC.cpp Player.cpp mm7_1.cpp mm7_5.cpp mm7_6.cpp
diffstat 8 files changed, 115 insertions(+), 116 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/Indoor.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -4667,8 +4667,8 @@
       if (uItemID)
       {
         if (uItemID != 220 && pItemsTable->pItems[uItemID].uEquipType == EQUIP_POTION &&
-            !p->stru_24.uEncantmentType)
-          p->stru_24.uEncantmentType = rand() % 15 + 5;
+            !p->stru_24.uEnchantmentType)
+          p->stru_24.uEnchantmentType = rand() % 15 + 5;
         pItemsTable->SetSpecialBonus(&p->stru_24);
       }
     }
--- a/Items.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/Items.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -255,7 +255,7 @@
   this->uNumCharges = 0;
   this->uSpecEnchantmentType = 0;
   this->_bonus_strength = 0;
-  this->uEncantmentType = 0;
+  this->uEnchantmentType = 0;
   this->uItemID = 0;
   this->uBodyAnchor = 0;
   this->uExpireTime = 0i64;
@@ -268,7 +268,7 @@
   {
     if ( uTimePlayed > (signed __int64)this->uExpireTime )
     {
-      this->uEncantmentType = 0;
+      this->uEnchantmentType = 0;
       this->uSpecEnchantmentType = 0;
       this->uAttributes = this->uAttributes&(~ITEM_TEMP_BONUS);
     }
@@ -381,7 +381,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -485,7 +485,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -497,7 +497,7 @@
 	memset(&pSpecialEnchantmentsSumm, 0, 96);
 	for(i=0;i<12;++i)
 		{
-		for (j=0;j<pSpecialEnchantments_count;++j)
+		for (j=0;j<=pSpecialEnchantments_count;++j)
 			pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i];
 		}
 
@@ -838,7 +838,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -905,7 +905,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -1044,7 +1044,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -1096,7 +1096,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -1199,7 +1199,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -1236,7 +1236,7 @@
 				}
 			else
 				{ 
-				if (!decode_step)
+				if (decode_step)
 					break_loop = true;
 				}
 			++decode_step;
@@ -1251,7 +1251,7 @@
 {
   if ( pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL )
   {
-    pItem->uEncantmentType = pItems[pItem->uItemID]._bonus_type;
+    pItem->uEnchantmentType = pItems[pItem->uItemID]._bonus_type;
     pItem->uSpecEnchantmentType = pItems[pItem->uItemID]._additional_value;
     pItem->_bonus_strength = pItems[pItem->uItemID]._bonus_strength;
   }
@@ -1441,7 +1441,7 @@
 	uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
 	if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) )
 		return uBaseValue;
-	if (uEncantmentType )
+	if (uEnchantmentType )
 		return uBaseValue + 100 * _bonus_strength;;
 	if (uSpecEnchantmentType )
 		{
@@ -1494,10 +1494,10 @@
   }
   if ( !pItemsTable->IsMaterialNonCommon(this) )
   {
-    if ( uEncantmentType )
+    if ( uEnchantmentType )
     {
       strcat(item__getname_buffer, " ");
-      nameModificator = pItemsTable->pEnchantments[uEncantmentType-1].pOfName;
+      nameModificator = pItemsTable->pEnchantments[uEnchantmentType-1].pOfName;
     }
     else
     {
@@ -1693,10 +1693,10 @@
 
         if (pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
             {// if it potion set potion spec
-            out_item->uEncantmentType = 0;
+            out_item->uEnchantmentType = 0;
             for (int i=0; i<2; ++i)
-                out_item->uEncantmentType += rand() % 4 + 1;
-            out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; 
+                out_item->uEnchantmentType += rand() % 4 + 1;
+            out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; 
             }
         }
     else
@@ -1733,12 +1733,12 @@
             out_item->uItemID = 1;
         if (pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
             {// if it potion set potion spec
-            out_item->uEncantmentType = 0;
+            out_item->uEnchantmentType = 0;
             for (int i=0; i<2; ++i)
-                out_item->uEncantmentType += rand() % 4 + 1;
-            out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; 
+                out_item->uEnchantmentType += rand() % 4 + 1;
+            out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; 
             }
-        out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; 
+        out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; 
         }
 
     if ( out_item->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
@@ -1752,7 +1752,7 @@
     if ( pItems[out_item->uItemID].uEquipType != EQUIP_POTION )
         {
         out_item->uSpecEnchantmentType = 0;
-        out_item->uEncantmentType = 0;
+        out_item->uEnchantmentType = 0;
         }
     //try get special enhansment
     switch (pItems[out_item->uItemID].uEquipType)
@@ -1773,39 +1773,39 @@
     case      EQUIP_GAUNTLETS :      
     case      EQUIP_BOOTS  :        
     case      EQUIP_RING   : 
-        v22 = uBonusChanceStandart[v6];
+        
         if ( !uBonusChanceStandart[v6] )
             return;
-        v24 = v22;
         special_chance = rand() % 100;
-        if ( !uBonusChanceSpecial[v6] && !(special_chance < uBonusChanceStandart[v6]))
-            return;
         if ( special_chance < uBonusChanceStandart[v6])
             {
-            v26 = rand() % v5->uBonusChanceWpSpecial[v5->pItems[out_item->uItemID].uEquipType + 3];
-            v27 = out_item->uItemID;
-            out_item->uEncantmentType = 0;
-            for ( i = pEnchantments[0].to_item[pItems[v27].uEquipType + 1];
-                i < v26;
-                i += pEnchantments[out_item->uEncantmentType].to_item[pItems[v29].uEquipType + 1] )
+              v26 = rand() %pEnchantmentsSumm[pItems[out_item->uItemID].uEquipType-3]; 
+            out_item->uEnchantmentType = 0;
+            v27=pEnchantments[out_item->uEnchantmentType].to_item[pItems[out_item->uItemID].uEquipType-3];
+            if (v26>v27 )
+                {
+                do 
                 {
-                v29 = out_item->uItemID;
-                ++out_item->uEncantmentType;
-                }
-            ++out_item->uEncantmentType;
-            v30 = bonus_ranges[v6].minR;
-            v32 = out_item->uEncantmentType - 1;
-            v33 = rand() % (bonus_ranges[v6].maxR - v30 + 1) + v30;
-            out_item->_bonus_strength = v33;
-            if ( v32 == 21 || v32 == 22 || v32 == 23 )
-                out_item->_bonus_strength = v33 >> 1;
+                ++out_item->uEnchantmentType;
+                v27+=pEnchantments[out_item->uEnchantmentType].to_item[pItems[out_item->uItemID].uEquipType-3];
+                } while (v26>v27);
+            }
+            ++out_item->uEnchantmentType;
+
+            v33 = rand() % (bonus_ranges[v6].maxR - bonus_ranges[v6].minR + 1);
+            out_item->_bonus_strength = v33 + bonus_ranges[v6].minR;
+            v32 = out_item->uEnchantmentType - 1;
+            if ( v32 == 21 || v32 == 22 || v32 == 23 ) //Armsmaster skill, Dodge skill, Unarmed skill 
+                out_item->_bonus_strength = out_item->_bonus_strength/2;
             if ( out_item->_bonus_strength <= 0 )
                 out_item->_bonus_strength = 1;
             return;
             
             }
+        if ( !uBonusChanceSpecial[v6])
+            return;
         v34 = uBonusChanceStandart[v6] + uBonusChanceSpecial[v6];
-        if ( special_chance<v34 )
+        if ( special_chance>v34 )
             return;
         break;
     case EQUIP_WAND:
--- a/Items.h	Tue Mar 05 16:14:22 2013 +0200
+++ b/Items.h	Wed Mar 06 00:09:49 2013 +0400
@@ -140,7 +140,7 @@
 
 
   int uItemID;
-  int uEncantmentType;
+  int uEnchantmentType;
   int _bonus_strength;
   int uSpecEnchantmentType; // 25: +5 levels
   int uNumCharges;
--- a/NPC.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/NPC.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -484,7 +484,7 @@
 					}
 				else
 					{ 
-					if (!decode_step)
+					if (decode_step)
 						break_loop = true;
 					}
 				++decode_step;
--- a/Player.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/Player.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -3575,7 +3575,7 @@
               if ( pItemsTable->pItems[v17].uEquipType == 14 )
               {
                 if ( v16 != 220 )
-                  v27.uEncantmentType = 2 * rand() % 4 + 2;
+                  v27.uEnchantmentType = 2 * rand() % 4 + 2;
               }
             }
             else
@@ -7006,10 +7006,10 @@
     switch ( pParty->pPickedItem.uItemID )
     {
       case 0xDEu:
-        v25 = pParty->pPickedItem.uEncantmentType + 10;
+        v25 = pParty->pPickedItem.uEnchantmentType + 10;
         goto LABEL_110;
       case 0xDFu:
-        v26 = pParty->pPickedItem.uEncantmentType + 10;
+        v26 = pParty->pPickedItem.uEnchantmentType + 10;
         goto LABEL_114;
       case 0xE0u:
         LODWORD(v3->pConditions[1]) = 0;
@@ -7042,7 +7042,7 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[7];
         goto LABEL_147;
       case 0xE5u:
@@ -7050,7 +7050,7 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[8];
         goto LABEL_147;
       case 0xE6u:
@@ -7058,23 +7058,23 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[1];
         goto LABEL_147;
       case 0xE7u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[11];
         goto LABEL_147;
       case 0xE8u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[13];
         goto LABEL_147;
       case 0xEAu:
@@ -7082,12 +7082,12 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[14];
         goto LABEL_147;
       case 0xEBu:
         v3->pPlayerBuffs[23].Apply(
-          pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335),
+          pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
           3u,
           5u,
           0,
@@ -7108,49 +7108,49 @@
       case 0xF0u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[19];
         goto LABEL_147;
       case 0xF1u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[17];
         goto LABEL_147;
       case 0xF2u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[20];
         goto LABEL_147;
       case 0xF3u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[16];
         goto LABEL_147;
       case 0xF4u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[21];
         goto LABEL_147;
       case 0xF5u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[15];
         goto LABEL_147;
       case 0xFBu:
@@ -7173,12 +7173,12 @@
         HIDWORD(v3->pConditions[16]) = v35;
         goto LABEL_112;
       case 0xFDu:
-        v25 = 5 * pParty->pPickedItem.uEncantmentType;
+        v25 = 5 * pParty->pPickedItem.uEnchantmentType;
 LABEL_110:
         v69 = v25;
         goto LABEL_111;
       case 0xFEu:
-        v26 = 5 * pParty->pPickedItem.uEncantmentType;
+        v26 = 5 * pParty->pPickedItem.uEnchantmentType;
 LABEL_114:
         v27 = (char *)&v3->sMana;
         *(int *)v27 += v26;
@@ -7186,57 +7186,57 @@
       case 0xFFu:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[18];
         goto LABEL_147;
       case 0x100u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[5];
         goto LABEL_147;
       case 0x101u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)v3->pPlayerBuffs;
         goto LABEL_147;
       case 0x102u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[22];
         goto LABEL_147;
       case 0x103u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[3];
         goto LABEL_147;
       case 0x104u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[9];
         goto LABEL_147;
       case 0x105u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[2];
 LABEL_147:
         ((SpellBuff *)v29)->Apply(pParty->uTimePlayed + v28, v46, v50, v59, v70);
--- a/mm7_1.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/mm7_1.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -2479,24 +2479,23 @@
         if (item_desc->uDamageDice) //"Armor"	
           sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod);
       break;
-      case EQUIP_POTION:
-          if ( inspect_item->uEncantmentType )
-              sprintf(out_text + 200,  "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power"
-          break;
-      case EQUIP_REAGENT:
-         sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
-         break;
+      
     }
 
     if ( v77 )
       goto LABEL_65;
-    //v23 = item_desc->uEquipType;
-    
-
-    if ( inspect_item->uEncantmentType )
+    if  (item_desc->uEquipType==EQUIP_POTION)
+        {        
+        if ( inspect_item->uEnchantmentType )
+            sprintf(out_text + 200,  "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power"
+        }
+    else if  (item_desc->uEquipType== EQUIP_REAGENT)
+        {sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
+        }
+    else if ( inspect_item->uEnchantmentType )
      {
         sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210],
-             pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special"
+             pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special"
     }
     else  if ( inspect_item->uSpecEnchantmentType )
       {      
@@ -2537,7 +2536,7 @@
         wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54;
         if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight )
             wHintWindow.uFrameHeight = (unsigned int)Str;
-        if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
+        if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
             wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
         v85 = 0;
         if ( pFontArrus->uFontHeight )
@@ -2605,7 +2604,7 @@
                 }
             else
                 {
-                if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
+                if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
                     {
                     sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
                     strcpy(pTmpBuf, "Duration:");
--- a/mm7_5.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/mm7_5.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -15430,7 +15430,7 @@
       v27 = &v0->pInventoryItems[pOut.z];
       v28 = v27->uItemID;
       v51 = pItemsTable->pItems[v27->uItemID].uEquipType;
-      v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEncantmentType);
+      v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEnchantmentType);
       if ( pParty->pPickedItem.uItemID != 233 )
       {
         if ( pParty->pPickedItem.uItemID == 236 )
@@ -15452,7 +15452,7 @@
             if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65
               || (pOut.y = v27->uAttributes, pOut.y & 2)
               || v27->uSpecEnchantmentType
-              || v27->uEncantmentType
+              || v27->uEnchantmentType
               || v51 && v51 != 1 && v51 != 2
               || (signed int)v33 >= 500 )
               goto LABEL_92;
@@ -15468,7 +15468,7 @@
               && (signed int)v30 <= 65
               || (pOut.y = v27->uAttributes, pOut.y & 2)
               || v27->uSpecEnchantmentType
-              || v27->uEncantmentType
+              || v27->uEnchantmentType
               || v51 && v51 != 1 && v51 != 2
               || (signed int)v30 >= 500 )
               goto LABEL_92;
@@ -15486,7 +15486,7 @@
         dword_50C9A8 = 256;
         goto LABEL_92;
       }
-      v36 = (70.0 - (double)pParty->pPickedItem.uEncantmentType) * 0.01;
+      v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01;
       if ( v36 < 0.0 )
         v36 = 0.0;
       if ( v51 != 12 )
@@ -15635,8 +15635,8 @@
                 *(int *)&v0->field_1F5[36 * v19 + 15] = 1;
               v20 = v47 + 50 * v15;
               v0->pInventoryItems[pOut.z].uItemID = v51;
-              v0->pInventoryItems[pOut.z].uEncantmentType = (pParty->pPickedItem.uEncantmentType
-                                                       + v0->pInventoryItems[pOut.z].uEncantmentType)
+              v0->pInventoryItems[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
+                                                       + v0->pInventoryItems[pOut.z].uEnchantmentType)
                                                       / 2;
               v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168  + 388
 LABEL_74:
@@ -15653,7 +15653,7 @@
               if ( *(int *)(a2.y + 532) == 221 )
                 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID;
               else
-                *(int *)(a2.y + 536) = pParty->pPickedItem.uEncantmentType;
+                *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType;
               v21 = v0->AddItem(0xFFFFFFFFu, 0xDCu);
               if ( v21 )
                 *(int *)&v0->field_1F5[36 * v21 + 15] = 1;
--- a/mm7_6.cpp	Tue Mar 05 16:14:22 2013 +0200
+++ b/mm7_6.cpp	Wed Mar 06 00:09:49 2013 +0400
@@ -1431,7 +1431,7 @@
       v4 = Dst.uItemID;
     }
     if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
-      Dst.uEncantmentType = 2 * rand() % 4 + 2;
+      Dst.uEnchantmentType = 2 * rand() % 4 + 2;
     pItemsTable->SetSpecialBonus(&Dst);
     if ( !pParty->AddItem(&Dst) )
       pParty->SetHoldingItem(&Dst);
@@ -3980,7 +3980,7 @@
           {
             if (!v730c->uSpecEnchantmentType)
             {
-              if (!v730c->uEncantmentType)
+              if (!v730c->uEnchantmentType)
               {
                 v68 = BYTE4(v726->pConditions[3]);
                 if ( !v68 || v68 == 1 || v68 == 2 )
@@ -5307,7 +5307,7 @@
             if ( v731 != 4
               || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134)
               || v726->pInventoryItems[a2].uSpecEnchantmentType != 0
-              || v726->pInventoryItems[a2].uEncantmentType != 0
+              || v726->pInventoryItems[a2].uEnchantmentType != 0
               || v726->pInventoryItems[a2]._bonus_strength != 0
               || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) )
               goto LABEL_616;
@@ -5412,7 +5412,7 @@
         LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4;
         if ( v290 > 134
           || _this->uSpecEnchantmentType != 0
-          || _this->uEncantmentType != 0
+          || _this->uEnchantmentType != 0
           || _this->_bonus_strength != 0
           || (v291 = pItemsTable->pItems[v290].uEquipType) == 0
           || v291 == 1
@@ -5487,13 +5487,13 @@
           v293 = rand();
           v294 = _this;
           v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
-          _this->uEncantmentType = 0;
+          _this->uEnchantmentType = 0;
           for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
                 ;
-                kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
+                kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
                                                                          + 1] )
           {
-            ++v294->uEncantmentType;
+            ++v294->uEnchantmentType;
             if ( kk >= v295 )
               break;
           }