changeset 381:39a60868e9c7

Merge
author Nomad
date Fri, 22 Feb 2013 22:36:31 +0200
parents 2f67762d04f6 (current diff) 243418228760 (diff)
children c3a0d94c07a5
files mm7_4.cpp
diffstat 13 files changed, 390 insertions(+), 265 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/Actor.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -343,7 +343,7 @@
       if ( v2 )
       {
         v1->array_000234[3].uItemID = 197;
-        v1->array_000234[3].uAdditionalValue = v2;
+        v1->array_000234[3].uSpecEnchantmentType = v2;
       }
     }
   }
--- a/Items.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/Items.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -77,7 +77,7 @@
     *v3 = v5;
     return v5;
   }
-  v8 = v4->uAdditionalValue;
+  v8 = v4->uSpecEnchantmentType;
   if ( v8 > 46 )
   {
     v5 = 0;
@@ -184,12 +184,12 @@
 //----- (00402F07) --------------------------------------------------------
 void ItemGen::Reset()
 {
-  this->field_1A = 0;
+  this->uHolderPlayer = 0;
   this->uAttributes = 0;
   this->uNumCharges = 0;
-  this->uAdditionalValue = 0;
+  this->uSpecEnchantmentType = 0;
   this->_bonus_strength = 0;
-  this->_bonus_type = 0;
+  this->uEncantmentType = 0;
   this->uItemID = 0;
   this->uBodyAnchor = 0;
   this->uExpireTime = 0i64;
@@ -205,35 +205,31 @@
   {
     if ( uTimePlayed > (signed __int64)this->uExpireTime )
     {
-      this->_bonus_type = 0;
+      this->uEncantmentType = 0;
       LOBYTE(v2) = v2 & 0xF7;
-      this->uAdditionalValue = 0;
+      this->uSpecEnchantmentType = 0;
       this->uAttributes = v2;
     }
   }
 }
 
 //----- (0045814E) --------------------------------------------------------
-char *ItemsTable::Release()
+void ItemsTable::Release()
 {
-  ItemsTable *v1; // edi@1
-  char *result; // eax@23
-
-  v1 = this;
   if ( pMonstersTXT_Raw )
     pAllocator->FreeChunk(pMonstersTXT_Raw);
   if ( pMonsterPlacementTXT_Raw )
     pAllocator->FreeChunk(pMonsterPlacementTXT_Raw);
   if ( pSkillDescTXT_Raw )
     pAllocator->FreeChunk(pSkillDescTXT_Raw);
-  if ( v1->pSpcItemsTXT_Raw )
-    pAllocator->FreeChunk(v1->pSpcItemsTXT_Raw);
-  if ( v1->pStdItemsTXT_Raw )
-    pAllocator->FreeChunk(v1->pStdItemsTXT_Raw);
-  if ( v1->pRndItemsTXT_Raw )
-    pAllocator->FreeChunk(v1->pRndItemsTXT_Raw);
-  if ( v1->pItemsTXT_Raw )
-    pAllocator->FreeChunk(v1->pItemsTXT_Raw);
+  if (pSpcItemsTXT_Raw )
+    pAllocator->FreeChunk(pSpcItemsTXT_Raw);
+  if ( pStdItemsTXT_Raw )
+    pAllocator->FreeChunk(pStdItemsTXT_Raw);
+  if ( pRndItemsTXT_Raw )
+    pAllocator->FreeChunk(pRndItemsTXT_Raw);
+  if ( pItemsTXT_Raw )
+    pAllocator->FreeChunk(pItemsTXT_Raw);
   if ( pHostileTXT_Raw )
     pAllocator->FreeChunk(pHostileTXT_Raw);
   if ( pHistoryTXT_Raw )
@@ -242,13 +238,12 @@
     pAllocator->FreeChunk(pPotionsTXT_Raw);
   if ( pPotionNotesTXT_Raw )
     pAllocator->FreeChunk(pPotionNotesTXT_Raw);
-  v1->pSpcItemsTXT_Raw = 0;
-  pSkillDescTXT_Raw = 0;
-  v1->pStdItemsTXT_Raw = 0;
-  v1->pRndItemsTXT_Raw = pSkillDescTXT_Raw;
-  result = pSkillDescTXT_Raw;
-  v1->pItemsTXT_Raw = pSkillDescTXT_Raw;
-  return result;
+  pSpcItemsTXT_Raw = NULL;
+  pSkillDescTXT_Raw = NULL;
+  pStdItemsTXT_Raw = NULL;
+  pRndItemsTXT_Raw = NULL;
+  pItemsTXT_Raw = NULL;
+
 }
 
 
@@ -444,8 +439,6 @@
 			pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i];
 		}
 
-
-
 	Initialize2DA();
 
 	pItemsTXT_Raw = NULL;
@@ -573,7 +566,7 @@
 						}
 					if ( !_strcmpi(test_string, "sscroll") )
 						{
-						pItems[item_counter].uEquipType = 15;
+						pItems[item_counter].uEquipType = EQUIP_SPELL_SCROLL;
 						break;
 						}
 					if ( !_strcmpi(test_string, "book") )
@@ -583,7 +576,7 @@
 						}
 					if ( !_strcmpi(test_string, "mscroll") )
 						{
-						pItems[item_counter].uEquipType = 17;
+						pItems[item_counter].uEquipType = EQUIP_MESSAGE_SCROLL;
 						break;
 						}
 					if ( !_strcmpi(test_string, "gold") )
@@ -603,70 +596,70 @@
 					{
 					if ( !_strcmpi(test_string, "staff") )
 						{
-						pItems[item_counter].uSkillType = 0;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_STAFF;
 						break;
 						}
 					if ( !_strcmpi(test_string, "sword") )
 						{
-						pItems[item_counter].uSkillType = 1;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_SWORD;
 						break;
 						}
 					if ( !_strcmpi(test_string, "dagger") )
 						{
-						pItems[item_counter].uSkillType = 2;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_DAGGER;
 						break;
 						}
 					if ( !_strcmpi(test_string, "axe") )
 						{
-						pItems[item_counter].uSkillType = 3;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_AXE;
 						break;
 						}
 					if ( !_strcmpi(test_string, "spear") )
 						{
-						pItems[item_counter].uSkillType = 4;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_SPEAR;
 						break;
 						}
 					if ( !_strcmpi(test_string, "bow") )
 						{
-						pItems[item_counter].uSkillType = 5;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_BOW;
 						break;
 						}
 					if ( !_strcmpi(test_string, "mace") )
 						{
-						pItems[item_counter].uSkillType = 6;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_MACE;
 						break;
 						}
 					if ( !_strcmpi(test_string, "blaster") )
 						{
-						pItems[item_counter].uSkillType = 7;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_BLASTER;
 						break;
 						}
 					if ( !_strcmpi(test_string, "shield") )
 						{
-						pItems[item_counter].uSkillType = 8;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_SHIELD;
 						break;
 						}
 					if ( !_strcmpi(test_string, "leather") )
 						{
-						pItems[item_counter].uSkillType = 9;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_LEATHER;
 						break;
 						}
 					if ( !_strcmpi(test_string, "chain") )
 						{
-						pItems[item_counter].uSkillType = 10;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_CHAIN;
 						break;
 						}
 					if ( !_strcmpi(test_string, "plate") )
 						{
-						pItems[item_counter].uSkillType = 11;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_PLATE;
 						break;
 						}
 					if ( !_strcmpi(test_string, "club") )
 						{
-						pItems[item_counter].uSkillType = 37;
+						pItems[item_counter].uSkillType = PLAYER_SKILL_CLUB;
 						break;
 						}
-					pItems[item_counter].uSkillType = 38;
+					pItems[item_counter].uSkillType = PLAYER_SKILL_ANY;
 					break;
 					}
 				case 6: //Mod1
@@ -705,20 +698,20 @@
 					{
 					if ( !_strcmpi(test_string, "artifact") )
 						{
-						pItems[item_counter].uMaterial = 1;
+						pItems[item_counter].uMaterial = MATERIAL_ARTEFACT;
 						break;
 						}
 					if ( !_strcmpi(test_string, "relic") )
 						{
-						pItems[item_counter].uMaterial = 2;
+						pItems[item_counter].uMaterial = MATERIAL_RELIC;
 						break;
 						}
 					if ( !_strcmpi(test_string, "special") )
 						{
-						pItems[item_counter].uMaterial = 3;
+						pItems[item_counter].uMaterial = MATERIAL_SPECIAL;
 						break;
 						}
-					pItems[item_counter].uMaterial = 0;
+					pItems[item_counter].uMaterial = MATERIAL_COMMON;
 					break;}
 				case 9:  //ID/Rep/St
 					pItems[item_counter].uItemID_Rep_St=atoi(test_string);
@@ -733,7 +726,7 @@
 					{
 					pItems[item_counter]._additional_value=0;
 					pItems[item_counter]._bonus_type=0;
-					if (pItems[item_counter].uMaterial==3)
+					if (pItems[item_counter].uMaterial==MATERIAL_SPECIAL)
 						{
 						for(int ii=0; ii<24; ++ii)
 							{
@@ -758,7 +751,7 @@
 					break;
 					}
 				case 13: //VarB
-					if ((pItems[item_counter].uMaterial==3)&&(pItems[item_counter]._bonus_type))
+					if ((pItems[item_counter].uMaterial==MATERIAL_SPECIAL)&&(pItems[item_counter]._bonus_type))
 						{
 						char b_s=atoi(test_string);
 						if (b_s)
@@ -1199,25 +1192,25 @@
   v2 = &this->pItems[pItem->uItemID];
   if ( v2->uMaterial == 3 )
   {
-    pItem->_bonus_type = v2->_bonus_type;
-    pItem->uAdditionalValue = v2->_additional_value;
+    pItem->uEncantmentType = v2->_bonus_type;
+    pItem->uSpecEnchantmentType = v2->_additional_value;
     pItem->_bonus_strength = v2->_bonus_strength;
   }
 }
 
 //----- (00456D43) --------------------------------------------------------
-bool ItemsTable::_456D43_is_material_equals_3(ItemGen *pItem)
+bool ItemsTable::IsMaterialSpecial(ItemGen *pItem)
 {
-  return this->pItems[pItem->uItemID].uMaterial == 3;
+  return this->pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL;
 }
 
 //----- (00456D5E) --------------------------------------------------------
-bool ItemsTable::_456D5E_is_some_material(ItemGen *pItem)
+bool ItemsTable::IsMaterialNonCommon(ItemGen *pItem)
 {
   unsigned __int8 v2; // al@1
 
   v2 = this->pItems[pItem->uItemID].uMaterial;
-  return v2 == 3 || v2 == 1 || v2 == 2;
+  return v2 == MATERIAL_SPECIAL || v2 == MATERIAL_RELIC || v2 == MATERIAL_ARTEFACT;
 }
 
 
@@ -1392,14 +1385,14 @@
 
   v1 = this;
   uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
-  if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->_456D5E_is_some_material(this) )
+  if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) )
     return uBaseValue;
-  if ( v1->_bonus_type )
+  if ( v1->uEncantmentType )
   {
     v3 = 100 * v1->_bonus_strength;
     return uBaseValue + v3;
   }
-  v4 = v1->uAdditionalValue;
+  v4 = v1->uSpecEnchantmentType;
   if ( !v4 )
   {
     result = uBaseValue;
@@ -1426,89 +1419,69 @@
 //----- (004564B3) --------------------------------------------------------
 const char *ItemGen::GetIdentifiedName()
 {
-  ItemGen *v1; // esi@1
-  unsigned int v2; // eax@1
-  unsigned __int8 v3; // cl@1
-  char *v4; // edi@4
-  char v5; // al@6
-  const char *v6; // esi@8
-  int v7; // eax@15
-  const char *v9; // [sp-Ch] [bp-14h]@14
-  const char *v10; // [sp-8h] [bp-10h]@4
-  char *v11; // [sp-4h] [bp-Ch]@4
+  unsigned __int8 equip_type; 
+  const char *player_name; 
+  const char *nameModificator; 
+  const char *format_str; 
 
-  v1 = this;
-  v2 = this->uItemID;
-  v3 = pItemsTable->pItems[v2].uEquipType;
-  if ( v3 >= EQUIP_REAGENT && (v3 <= EQUIP_POTION || v3 == EQUIP_GOLD) )
+  equip_type = pItemsTable->pItems[uItemID].uEquipType;
+  if ( (equip_type == EQUIP_REAGENT) || (equip_type == EQUIP_POTION) || (equip_type == EQUIP_GOLD) )
   {
-    v11 = pItemsTable->pItems[v2].pName;
-    v4 = item__getname_buffer;
-    v10 = "%s";
-    sprintf(v4, v10, v11);
-    return v4;
+    sprintf(item__getname_buffer, "%s", pItemsTable->pItems[uItemID].pName);
+    return item__getname_buffer;
   }
-  v4 = item__getname_buffer;
-  sprintf(item__getname_buffer, "%s", pItemsTable->pItems[v2].pName);
-  if ( v1->uItemID == 601 )
+  sprintf(item__getname_buffer, "%s", pItemsTable->pItems[uItemID].pName);
+  if ( uItemID == ITEM_LICH_JAR )  //Lich Jar
   {
-    v5 = v1->field_1A;
-    if ( (unsigned __int8)v5 >= 1u )
-    {
-      if ( (unsigned __int8)v5 <= 4u )
+    if ( (uHolderPlayer >0 )&& (uHolderPlayer <= 4) )
       {
-        v6 = pPlayers[(unsigned __int8)v5]->pName;
-        strlen(pPlayers[(unsigned __int8)v5]->pName);
-        v11 = (char *)v6;
-        if ( v6[strlen(v6) - 1] == 115 )
-          v10 = pGlobalTXT_LocalizationStrings[655];
+        player_name = pPlayers[uHolderPlayer]->pName;
+        strlen(player_name);
+        if ( player_name[strlen(player_name) - 1] == 's' )
+          format_str = pGlobalTXT_LocalizationStrings[655]; //"%s' Jar"
         else
-          v10 = pGlobalTXT_LocalizationStrings[654];
-		sprintf(v4, v10, v11);
-		return v4;
+          format_str = pGlobalTXT_LocalizationStrings[654]; //"%s's Jar"
+		sprintf(item__getname_buffer, format_str, pPlayers[uHolderPlayer]->pName);
+		return item__getname_buffer;
       }
-    }
   }
-  if ( !pItemsTable->_456D5E_is_some_material(v1) )
+  if ( !pItemsTable->IsMaterialNonCommon(this) )
   {
-    if ( v1->_bonus_type )
+    if ( uEncantmentType )
     {
       strcat(item__getname_buffer, " ");
-      v9 = (const char *)*((unsigned int *)&pItemsTable->pItems[799].uEquipType + 5 * v1->_bonus_type);
+      nameModificator = pItemsTable->pEnchantments[uEncantmentType-1].pOfName;
     }
     else
     {
-      v7 = v1->uAdditionalValue;
-      if ( !v7 )
-        return v4;
-      if ( v7 == 16
-        || v7 == 39
-        || v7 == 40
-        || v7 == 45
-        || v7 == 56
-        || v7 == 57
-        || v7 == 58
-        || v7 == 60
-        || v7 == 61
-        || v7 == 59
-        || v7 == 63
-        || v7 == 64
-        || v7 == 67
-        || v7 == 68 )
-      {
-        sprintf(
-          item__getname_buffer,
-          "%s %s",
-		  pItemsTable->pSpecialEnchantments[v7].pBonusStatement,
-          pItemsTable->pItems[v1->uItemID].pName);
-        return v4;
+      if ( !uSpecEnchantmentType )
+        return item__getname_buffer;
+      if ( uSpecEnchantmentType == 16 //Drain Hit Points from target.
+        || uSpecEnchantmentType == 39 //Double damage vs Demons.
+        || uSpecEnchantmentType == 40 //Double damage vs Dragons
+        || uSpecEnchantmentType == 45 //+5 Speed and Accuracy
+        || uSpecEnchantmentType == 56 //+5 Might and Endurance.
+        || uSpecEnchantmentType == 57 //+5 Intellect and Personality.
+        || uSpecEnchantmentType == 58 //Increased Value.
+        || uSpecEnchantmentType == 60 //+3 Unarmed and Dodging skills
+        || uSpecEnchantmentType == 61 //+3 Stealing and Disarm skills.
+        || uSpecEnchantmentType == 59  //Increased Weapon speed.
+        || uSpecEnchantmentType == 63 //Double Damage vs. Elves.
+        || uSpecEnchantmentType == 64 //Double Damage vs. Undead.
+        || uSpecEnchantmentType == 67 //Adds 5 points of Body damage and +2 Disarm skill.
+        || uSpecEnchantmentType == 68 ) //Adds 6-8 points of Cold damage and +5 Armor Class.
+      {  //enchantment and name positions inverted!
+        sprintf( item__getname_buffer, "%s %s",
+				  pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd,
+				  pItemsTable->pItems[uItemID].pName);
+        return item__getname_buffer;
       }
       strcat(item__getname_buffer, " ");
-	  v9 = pItemsTable->pSpecialEnchantments[v1->uAdditionalValue].pBonusStatement;
+	  nameModificator = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd;
     }
-    strcat(item__getname_buffer, v9);
+    strcat(item__getname_buffer, nameModificator);
   }
-  return v4;
+  return item__getname_buffer;
 }
 
 
@@ -1614,7 +1587,7 @@
       case 40: requested_equip = EQUIP_RING; break;
       case 41: requested_equip = EQUIP_AMULET; break;
       case 42: requested_equip = EQUIP_WAND; break;
-      case 43: requested_equip = EQUIP_F; break;
+	  case 43: requested_equip = EQUIP_SPELL_SCROLL; break;
       case 44: requested_equip = EQUIP_POTION; break;
       case 45: requested_equip = EQUIP_REAGENT; break;
       case 46: requested_equip = EQUIP_GEM; break;
@@ -1673,16 +1646,16 @@
     }
     if (pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE )
     {
-      v4->_bonus_type = 0;
+      v4->uEncantmentType = 0;
       v14 = 2;
       do
       {
-        v4->_bonus_type += rand() % 4 + 1;
-        v15 = v4->_bonus_type;
+        v4->uEncantmentType += rand() % 4 + 1;
+        v15 = v4->uEncantmentType;
         --v14;
       }
       while ( v14 );
-      v4->_bonus_type = v15 * treasure_level;
+      v4->uEncantmentType = v15 * treasure_level;
     }
   }
   else
@@ -1716,16 +1689,16 @@
       v4->uItemID = 1;
     if (pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE)
     {
-      v4->_bonus_type = 0;
+      v4->uEncantmentType = 0;
       v19 = 2;
       do
       {
-        v4->_bonus_type += rand() % 4 + 1;
-        v15 = v4->_bonus_type;
+        v4->uEncantmentType += rand() % 4 + 1;
+        v15 = v4->uEncantmentType;
         --v19;
       }
       while ( v19 );
-      v4->_bonus_type = v15 * treasure_level;
+      v4->uEncantmentType = v15 * treasure_level;
     }
   }
   if ( v4->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
@@ -1737,8 +1710,8 @@
     v4->uAttributes = 1;
   if ( pItems[v4->uItemID].uEquipType != EQUIP_POTION )
   {
-    v4->uAdditionalValue = 0;
-    v4->_bonus_type = 0;
+    v4->uSpecEnchantmentType = 0;
+    v4->uEncantmentType = 0;
   }
   v20 = pItems[v4->uItemID].uEquipType;
   if ( v20 <= EQUIP_BOW )
@@ -1774,18 +1747,18 @@
     {
       v26 = rand() % 10;//v5->field_116D8[v5->pItems[v4->uItemID].uEquipType];
       v27 = v4->uItemID;
-      v4->_bonus_type = 0;
+      v4->uEncantmentType = 0;
       for ( i = pEnchantments[0].to_item[pItems[v27].uEquipType + 1];
             i < v26;
-            i += pEnchantments[v4->_bonus_type].to_item[pItems[v29].uEquipType + 1] )
+            i += pEnchantments[v4->uEncantmentType].to_item[pItems[v29].uEquipType + 1] )
       {
         v29 = v4->uItemID;
-        ++v4->_bonus_type;
+        ++v4->uEncantmentType;
       }
-      ++v4->_bonus_type;
+      ++v4->uEncantmentType;
       v30 = 10;// v5->field_116D8[2 * v54 + 12];
       v31 = rand();
-      v32 = v4->_bonus_type - 1;
+      v32 = v4->uEncantmentType - 1;
       v33 = v31 % 10;//(v5->field_116D8[2 * v54 + 13] - v30 + 1) + v30;
       v4->_bonus_strength = v33;
       if ( v32 == 21 || v32 == 22 || v32 == 23 )
@@ -1889,7 +1862,7 @@
     while ( a2b < pSpecialEnchantments_count );
   }
   v45 = rand();
-  v4->uAdditionalValue = *(uint *)Dst;
+  v4->uSpecEnchantmentType = *(uint *)Dst;
   v46 = v45 % v39 + 1;
   a2c = *((unsigned char *)&uAllItemsCount + 28 * (*(uint *)Dst + 1389) + pItems[v4->uItemID].uEquipType);
   if ( a2c < v46 )
@@ -1900,13 +1873,13 @@
       v49 = (int)(j + 1);
       v59 = v49;
       v50 = *(unsigned int *)v49;
-      v4->uAdditionalValue = v50;
+      v4->uSpecEnchantmentType = v50;
       a2c += *((unsigned char *)&uAllItemsCount + 28 * (v50 + 1389) + pItems[v48].uEquipType);
       if ( a2c >= v46 )
         break;
     }
   }
-  ++v4->uAdditionalValue;
+  ++v4->uSpecEnchantmentType;
 }
 
 //----- (004505CC) --------------------------------------------------------
--- a/Items.h	Fri Feb 22 22:34:35 2013 +0200
+++ b/Items.h	Fri Feb 22 22:36:31 2013 +0200
@@ -16,6 +16,14 @@
 };
 
 
+enum ITEM_MATERIAL
+	{
+	MATERIAL_COMMON  =0,
+	MATERIAL_ARTEFACT = 1,
+	MATERIAL_RELIC    = 2,
+	MATERIAL_SPECIAL  = 3 
+	};
+
 /*  330 */
 enum ITEM_TYPE
 {
@@ -58,6 +66,7 @@
   ITEM_ARTIFACT_PUCK = 0x1F4,
   ITEM_ARTIFACT_SPLITTER = 506,//1FA
   ITEM_RELIC_MEKORIGS_HAMMER = 0x210,
+  ITEM_LICH_JAR = 601
 };
 
 /*  331 */
@@ -71,19 +80,19 @@
   EQUIP_HELMET           = 5,
   EQUIP_BELT             = 6,
   EQUIP_CLOAK            = 7,
-  EQUIP_GAUNTLETS = 0x8,
-  EQUIP_BOOTS = 0x9,
-  EQUIP_RING = 10,
-  EQUIP_AMULET = 11,
-  EQUIP_WAND = 12,
-  EQUIP_REAGENT = 13,
-  EQUIP_POTION = 14,
-  EQUIP_F = 0xF,
-  EQUIP_BOOK = 16,
-  EQUIP_11 = 17,
-  EQUIP_GOLD = 18,
-  EQUIP_GEM = 19,
-  EQUIP_NONE = 20
+  EQUIP_GAUNTLETS        = 8,
+  EQUIP_BOOTS            = 9,
+  EQUIP_RING             = 10,
+  EQUIP_AMULET           = 11,
+  EQUIP_WAND             = 12,
+  EQUIP_REAGENT          = 13,
+  EQUIP_POTION           = 14,
+  EQUIP_SPELL_SCROLL     = 15,
+  EQUIP_BOOK             = 16,
+  EQUIP_MESSAGE_SCROLL   = 17,
+  EQUIP_GOLD             = 18,
+  EQUIP_GEM              = 19,
+  EQUIP_NONE             = 20
 };
 
 
@@ -114,14 +123,14 @@
 
 
   unsigned int uItemID;
-  int _bonus_type;
+  int uEncantmentType;
   int _bonus_strength;
-  int uAdditionalValue;
+  int uSpecEnchantmentType;
   int uNumCharges;
   unsigned int uAttributes;
   unsigned __int8 uBodyAnchor;
   char uMaxCharges;
-  char field_1A;
+  char uHolderPlayer;
   char field_1B;
   unsigned __int64 uExpireTime;
 };
@@ -227,9 +236,9 @@
   void LoadPotionNotes();
   void GenerateItem(int treasure_level, int a3, ItemGen *pItem);
   void SetSpecialBonus(ItemGen *pItem);
-  bool _456D43_is_material_equals_3(ItemGen *pItem);
-  bool _456D5E_is_some_material(ItemGen *pItem);
-  char *Release();
+  bool IsMaterialSpecial(ItemGen *pItem);
+  bool IsMaterialNonCommon(ItemGen *pItem);
+  void Release();
 
   int uAllItemsCount;
   ItemDesc pItems[800]; //4-9604h
@@ -266,4 +275,79 @@
 
 extern ItemGen *ptr_50C9A4;
 
-extern struct ItemsTable *pItemsTable;
\ No newline at end of file
+extern struct ItemsTable *pItemsTable;
+
+/*
++10 to all Resistances.	1
+	+10 to all Seven Statistics.	2
+	Explosive Impact!	3
+	Adds 3-4 points of Cold damage.	4
+	Adds 6-8 points of Cold damage.	5
+	Adds 9-12 points of Cold damage.	6
+	Adds 2-5 points of Electrical damage.	7
+	Adds 4-10 points of Electrical damage.	8
+	Adds 6-15 points of Electrical damage.	9
+	Adds 1-6 points of Fire damage.	10
+	Adds 2-12 points of Fire damage.	11
+	Adds 3-18 points of Fire damage.	12
+	Adds 5 points of Body damage.	13
+	Adds 8 points of Body damage.	14
+	Adds 12 points of Body damage.	15
+	Drain Hit Points from target.	16
+	Increases rate of Recovery.	17
+	Wearer resistant to Diseases.	18
+	Wearer resistant to Insanity.	19
+	Wearer resistant to Paralysis.	20
+	Wearer resistant to Poison.	21
+	Wearer resistant to Sleep.	22
+	Wearer resistant to Stone.	23
+	Increased Knockback.	24
+	+5 Level.	25
+	Increases effect of all Air spells.	26
+	Increases effect of all Body spells.	27
+	Increases effect of all Dark spells.	28
+	Increases effect of all Earth spells.	29
+	Increases effect of all Fire spells.	30
+	Increases effect of all Light spells.	31
+	Increases effect of all Mind spells.	32
+	Increases effect of all Spirit spells.	33
+	Increases effect of all Water spells.	34
+	Increases chance of Disarming.	35
+	Half damage from all missile attacks.	36
+	Regenerate Hit points over time.	37
+	Regenerate Spell points over time.	38
+	Double damage vs Demons.	39
+	Double damage vs Dragons	40
+	Drain Hit Points from target and Increased Weapon speed.	41
+	+1 to Seven Stats, HP, SP, Armor, Resistances.	42
+	+10 to Endurance, Armor, Hit points.	43
+	+10 Hit points and Regenerate Hit points over time.	44
+	+5 Speed and Accuracy.	45
+	Adds 10-20 points of Fire damage and +25 Might.	46
+	+10 Spell points and Regenerate Spell points over time.	47
+	+15 Endurance and +5 Armor.	48
+	+10 Intellect and Luck.	49
+	+30 Fire Resistance and Regenerate Hit points over time.	50
+	+10 Spell points, Speed, Intellect.	51
+	+10 Endurance and Accuracy.	52
+	+10 Might and Personality.	53
+	+15 Endurance and Regenerate Hit points over time.	54
+	+15 Luck and Regenerate Spell points over time.	55
+	+5 Might and Endurance.	56
+	+5 Intellect and Personality.	57
+	Increased Value.	58
+	Increased Weapon speed.	59
+	+3 Unarmed and Dodging skills.	60
+	+3 Stealing and Disarm skills.	61
+	+3 ID Item and ID Monster skills.	62
+	Double Damage vs. Elves.	63
+	Double Damage vs. Undead.	64
+	Double Damage vs. Titans.	65
+	Regenerate Spell points and Hit points over time.	66
+	Adds 5 points of Body damage and +2 Disarm skill.	67
+	Adds 6-8 points of Cold damage and +5 Armor Class.	68
+	+20 Air Resistance and Shielding.	69
+	+10 Water Resistance and +2 Alchemy skill.	70
+	Prevents damage from drowning.	71
+	Prevents damage from falling.	72
+*/
\ No newline at end of file
--- a/NPC.h	Fri Feb 22 22:34:35 2013 +0200
+++ b/NPC.h	Fri Feb 22 22:36:31 2013 +0200
@@ -1,5 +1,71 @@
 #pragma once
 
+/*
+enum NPCProffession
+	{
+	Smith	1
+	Armorer	2
+	Alchemist	3
+	Scholar	4
+	Guide	5
+	Tracker	6
+	Pathfinder	7
+	Sailor	8
+	Navigator	9
+	Healer	10
+	Expert Healer	11
+	Master Healer	12
+	Teacher	13
+	Instructor	14
+	Arms Master	15
+	Weapons Master	16
+	Apprentice	17
+	Mystic	18
+	Spell Master	19
+	Trader	20
+	Merchant	21
+	Scout	22
+	Herbalist	23
+	Apothecary	24
+	Tinker	25
+	Locksmith	26
+	Fool	27
+	Chimney Sweep	28
+	Porter	29
+	Quarter Master	30
+	Factor	31
+	Banker	32
+	Cook	33
+	Chef	34
+	Horseman	35
+	Bard	36
+	Enchanter	37
+	Cartographer	38
+	Wind Master	39
+	Water Master	40
+	Gate Master	41
+	Acolyte	42
+	Piper	43
+	Explorer	44
+	Pirate	45
+	Squire	46
+	Psychic	47
+	Gypsy	48
+	Diplomat	49
+	Duper	50
+	Burglar	51
+	Fallen Wizard	52
+	Acolyte	53
+	Initiate	54
+	Prelate	55
+	Monk	56
+	Sage	57
+	Hunter	58
+
+
+	};
+	*/
+
 
 struct NPCTopic
 {
@@ -147,8 +213,8 @@
 #pragma pack(push, 1)
 struct NPCGreeting
 {
-  char *pGreeting1;
-  char *pGreeting2;
+  char *pGreeting1;  //at first meet
+  char *pGreeting2;  // at latest meets
 };
 #pragma pack(pop)
 
--- a/Party.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/Party.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -1062,7 +1062,7 @@
       v8 = 138;
       do
       {
-		if ( v7->uItemID == 601 && (unsigned __int8)v7->field_1A== v15 + 1 )
+		if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer== v15 + 1 )
           v14 = 1;
         ++v7;
         --v8;
--- a/Player.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/Player.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -2796,7 +2796,7 @@
     v12 = pItemsTable->pItems[v8].uDamageMod + v28;
     if ( !uTargetActorID )
       goto LABEL_28;
-    v13 = v6->uAdditionalValue;
+    v13 = v6->uSpecEnchantmentType;
     if ( v13 == 64 || v7 == 507 || v7 == 508 || v7 == 527 )
     {
       v14 = (MONSTER_SUPERTYPE)1;
@@ -2867,7 +2867,7 @@
         v4 = pItemsTable->pItems[v17].uDamageMod + v29;
         if ( !uTargetActorID )
           goto LABEL_57;
-        v19 = v15->uAdditionalValue;
+        v19 = v15->uSpecEnchantmentType;
         if ( v19 == 64 || v16 == 507 || v16 == 508 || v16 == 527 )
         {
           v20 = (MONSTER_SUPERTYPE)1;
@@ -3048,7 +3048,7 @@
   v9 = pItemsTable->pItems[v6].uDamageMod + v17;
   if ( a2 )
   {
-    v10 = v4->uAdditionalValue;
+    v10 = v4->uSpecEnchantmentType;
     if ( v10 == 64 )
     {
       v11 = (MONSTER_SUPERTYPE)1;
@@ -3371,7 +3371,7 @@
   for (uint i = 0; i < 16; ++i)
   {
     if (HasItemEquipped((ITEM_EQUIP_TYPE)i) &&
-      pInventoryItems[i].uAdditionalValue == uEnchantment)
+      pInventoryItems[i].uSpecEnchantmentType == uEnchantment)
       //  *(int *)&this->field_1F6[36 * pEquipment[i] + 6] != uEnchantment)
       return true;
   }
@@ -3532,9 +3532,9 @@
           }
           if ( pItemsTable->pItems[v5->array_000234[3].uItemID].uEquipType != 18 )
             return _steal_perma;
-          v20 = (int)&v5->array_000234[3].uAdditionalValue;
-          if ( (signed int)v19 > v5->array_000234[3].uAdditionalValue )
-            v19 = v5->array_000234[3].uAdditionalValue;
+          v20 = (int)&v5->array_000234[3].uSpecEnchantmentType;
+          if ( (signed int)v19 > v5->array_000234[3].uSpecEnchantmentType )
+            v19 = v5->array_000234[3].uSpecEnchantmentType;
           v21 = *(int *)v20 == v19;
           *(int *)v20 -= v19;
           if ( v21 )
@@ -3580,7 +3580,7 @@
               if ( pItemsTable->pItems[v17].uEquipType == 14 )
               {
                 if ( v16 != 220 )
-                  v27._bonus_type = 2 * rand() % 4 + 2;
+                  v27.uEncantmentType = 2 * rand() % 4 + 2;
               }
             }
             else
@@ -4661,7 +4661,7 @@
     if ( (signed int)v3 >= 16 )
       return v2;
   }
-  if ( a2 != 24 || this->pInventoryItems[v5].uAdditionalValue != 24 )
+  if ( a2 != 24 || this->pInventoryItems[v5].uSpecEnchantmentType != 24 )
     goto LABEL_11;
   return 5;
 }
@@ -4900,8 +4900,8 @@
       }
       v63 = (int)((char *)v6 + 36 * v31);
       attra = (ItemGen *)(v63 + 532);
-      if ( pItemsTable->_456D5E_is_some_material((ItemGen *)(v63 + 532)) == 1
-        && !pItemsTable->_456D43_is_material_equals_3(attra) )
+      if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1
+        && !pItemsTable->IsMaterialSpecial(attra) )
       {
         v34 = attra->uItemID;
         switch ( attra->uItemID )
@@ -6969,10 +6969,10 @@
     switch ( pParty->pPickedItem.uItemID )
     {
       case 0xDEu:
-        v25 = pParty->pPickedItem._bonus_type + 10;
+        v25 = pParty->pPickedItem.uEncantmentType + 10;
         goto LABEL_110;
       case 0xDFu:
-        v26 = pParty->pPickedItem._bonus_type + 10;
+        v26 = pParty->pPickedItem.uEncantmentType + 10;
         goto LABEL_114;
       case 0xE0u:
         LODWORD(v3->pConditions[1]) = 0;
@@ -7005,7 +7005,7 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[7];
         goto LABEL_147;
       case 0xE5u:
@@ -7013,7 +7013,7 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[8];
         goto LABEL_147;
       case 0xE6u:
@@ -7021,23 +7021,23 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[1];
         goto LABEL_147;
       case 0xE7u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[11];
         goto LABEL_147;
       case 0xE8u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[13];
         goto LABEL_147;
       case 0xEAu:
@@ -7045,12 +7045,12 @@
         v59 = 0;
         v50 = 5;
         v46 = 3;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[14];
         goto LABEL_147;
       case 0xEBu:
         v3->pPlayerBuffs[23].Apply(
-          pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335),
+          pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335),
           3u,
           5u,
           0,
@@ -7071,49 +7071,49 @@
       case 0xF0u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[19];
         goto LABEL_147;
       case 0xF1u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[17];
         goto LABEL_147;
       case 0xF2u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[20];
         goto LABEL_147;
       case 0xF3u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[16];
         goto LABEL_147;
       case 0xF4u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[21];
         goto LABEL_147;
       case 0xF5u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[15];
         goto LABEL_147;
       case 0xFBu:
@@ -7136,12 +7136,12 @@
         HIDWORD(v3->pConditions[16]) = v35;
         goto LABEL_112;
       case 0xFDu:
-        v25 = 5 * pParty->pPickedItem._bonus_type;
+        v25 = 5 * pParty->pPickedItem.uEncantmentType;
 LABEL_110:
         v69 = v25;
         goto LABEL_111;
       case 0xFEu:
-        v26 = 5 * pParty->pPickedItem._bonus_type;
+        v26 = 5 * pParty->pPickedItem.uEncantmentType;
 LABEL_114:
         v27 = (char *)&v3->sMana;
         *(int *)v27 += v26;
@@ -7149,57 +7149,57 @@
       case 0xFFu:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[18];
         goto LABEL_147;
       case 0x100u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[5];
         goto LABEL_147;
       case 0x101u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)v3->pPlayerBuffs;
         goto LABEL_147;
       case 0x102u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[22];
         goto LABEL_147;
       case 0x103u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[3];
         goto LABEL_147;
       case 0x104u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[9];
         goto LABEL_147;
       case 0x105u:
         v70 = 0;
         v59 = 0;
-        v50 = 3 * LOWORD(pParty->pPickedItem._bonus_type);
+        v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType);
         v46 = 0;
-        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem._bonus_type) * 0.033333335);
+        v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335);
         v29 = (char *)&v3->pPlayerBuffs[2];
 LABEL_147:
         ((SpellBuff *)v29)->Apply(pParty->uTimePlayed + v28, v46, v50, v59, v70);
--- a/Player.h	Fri Feb 22 22:34:35 2013 +0200
+++ b/Player.h	Fri Feb 22 22:36:31 2013 +0200
@@ -215,7 +215,8 @@
   PLAYER_SKILL_STEALING = 34,
   PLAYER_SKILL_ALCHEMY = 35,
   PLAYER_SKILL_LEARNING = 36,
-
+  PLAYER_SKILL_CLUB = 37,
+  PLAYER_SKILL_ANY = 38,
   PLAYER_SKILL_INVALID = -1
 };
 
--- a/mm7_1.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_1.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -2362,7 +2362,7 @@
     v77 = 0;
     //a2.y = v8->uAttributes & 2;
     if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD)
-      v77 = v8->uAdditionalValue;
+      v77 = v8->uSpecEnchantmentType;
     if ( uActiveCharacter )
     {
       if (!v8->Identified())
@@ -2501,7 +2501,7 @@
     //v23 = item_desc->uEquipType;
     if (item_desc->uEquipType == 14)
     {
-      v24 = _this->_bonus_type;
+      v24 = _this->uEncantmentType;
       if ( v24 )
         goto LABEL_56;
 LABEL_65:
@@ -2531,7 +2531,7 @@
       v79.uFrameHeight = v73->uTextureHeight + v81 + 54;
       if ( (signed int)Str > (signed int)v79.uFrameHeight )
         v79.uFrameHeight = (unsigned int)Str;
-      if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) )
+      if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) )
         v79.uFrameHeight += LOBYTE(v82->uFontHeight);
       v83 = 0;
       if ( LOBYTE(pFontArrus->uFontHeight) )
@@ -2598,7 +2598,7 @@
       }
       else
       {
-        if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) )
+        if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) )
         {
           sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed);
           strcpy(pTmpBuf, "Duration:");
@@ -2667,7 +2667,7 @@
       sprintf(a1 + 200, v49, v54, v59);
       goto LABEL_65;
     }
-    v25 = _this->_bonus_type;
+    v25 = _this->uEncantmentType;
     if ( v25 )
     {
       v60 = _this->_bonus_strength;
@@ -2677,7 +2677,7 @@
     }
     else
     {
-      v26 = _this->uAdditionalValue;
+      v26 = _this->uSpecEnchantmentType;
       if ( !v26 )
       {
         if ( _this->uNumCharges )
@@ -4749,7 +4749,7 @@
       v5 = 5324 * (int)v0 + 36 * v4;
       if ( pItemsTable->pItems[*(unsigned int *)((char *)&pChests[0].mm7__vector_pItems[0].uItemID + v5)].uEquipType == 18 )
       {
-        party_finds_gold(*(int *)((char *)&pChests[0].mm7__vector_pItems[0].uAdditionalValue + v5), 0);
+        party_finds_gold(*(int *)((char *)&pChests[0].mm7__vector_pItems[0].uSpecEnchantmentType + v5), 0);
         viewparams->bRedrawGameUI = 1;
       }
       else
@@ -5904,7 +5904,7 @@
       v23 = pLayingItems[v21].stru_24.uItemID;
       if ( pItemsTable->pItems[v23].uEquipType == 18 )
       {
-        party_finds_gold(v22->uAdditionalValue, 0);
+        party_finds_gold(v22->uSpecEnchantmentType, 0);
         viewparams->bRedrawGameUI = 1;
       }
       else
--- a/mm7_2.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_2.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -7989,7 +7989,7 @@
                 }
                 a1a.stru_24.SetIdentified();
                 a1a.uObjectDescID = v18;
-                a1a.stru_24.uAdditionalValue = v34;
+                a1a.stru_24.uSpecEnchantmentType = v34;
                 goto LABEL_35;
               }
               v14 = rand() % 3001 + 2000;
@@ -8147,7 +8147,7 @@
                   }
 LABEL_23:
                   v3->SetIdentified();
-                  v3->uAdditionalValue = v10;
+                  v3->uSpecEnchantmentType = v10;
 LABEL_25:
                   v11 = v4 - 1;
                   v12 = 0;
@@ -8212,7 +8212,7 @@
                         v14->uItemID = 199;
                       }
 LABEL_49:
-                      v14->uAdditionalValue = v17;
+                      v14->uSpecEnchantmentType = v17;
 LABEL_51:
                       v12 = v13 + 1;
 LABEL_52:
@@ -15176,7 +15176,7 @@
       v20 = pLayingItems[v18].stru_24.uItemID;
       if ( pItemsTable->pItems[v20].uEquipType == 18 )
       {
-        party_finds_gold(v19->uAdditionalValue, 0);
+        party_finds_gold(v19->uSpecEnchantmentType, 0);
         viewparams->bRedrawGameUI = 1;
         v21 = v17;
       }
@@ -16583,7 +16583,7 @@
           break;
         case 545:
         case 550:
-          if ( v2->stru_24.uItemID != 405 && v2->stru_24.uAdditionalValue != 3 )
+          if ( v2->stru_24.uItemID != 405 && v2->stru_24.uSpecEnchantmentType != 3 )
           {
             v14 = v153;
             v9 = 0;
--- a/mm7_3.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_3.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -15135,7 +15135,7 @@
 	}
 	else if (v16 == 20)
 	{
-      __debugbreak(); // learn conditions of this event
+      //__debugbreak(); // learn conditions of this event instruments
       auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23];
       if (!topic)
       {
--- a/mm7_4.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_4.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -3562,7 +3562,7 @@
         }
         else
         {
-          v25 = v21->pInventoryItems[_idx].uAdditionalValue;
+          v25 = v21->pInventoryItems[_idx].uSpecEnchantmentType;
           if ( v25 <= 50 )
           {
             if ( v25 != 50 )
@@ -6173,6 +6173,7 @@
   pColor2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xECu, 0xE6u, 0x9Cu);
   pString = (char *)operator new(2 * pSize);
   strncpy(pString, ptr, pSize);
+  pString[pSize]=0;
   pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a4, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, 
 	  pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth);
   free(pString);
@@ -9340,9 +9341,9 @@
           {
 			if ( v7->uItemID == 601 )
             {
-			  if ( !v7->field_1A )
+			  if ( !v7->uHolderPlayer )
 				  v9 = v7;
-			  if ( v7->field_1A == v5 )
+			  if ( v7->uHolderPlayer == v5 )
                 v10 = 1;
             }
             ++v7;
@@ -9361,7 +9362,7 @@
         return;
     }
     if ( v9 )
-	  v9->field_1A = v5;
+	  v9->uHolderPlayer = v5;
   }
 }
 // 4F08EC: using guessed type int dword_4F08EC[];
--- a/mm7_5.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_5.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -5174,7 +5174,7 @@
   v19 = v4->stru_24.uItemID == 0;
   uDamageAmount = v17;
   v57 = 0;
-  if ( !v19 && v4->stru_24.uAdditionalValue == 3 )
+  if ( !v19 && v4->stru_24.uSpecEnchantmentType == 3 )
   {
     a2 = 0;
     v57 = (PlayerEquipment *)1;
@@ -15273,7 +15273,7 @@
                 else
                 {
                   if ( v26 >= 221 && v26 < 271 )
-                    pItemGen._bonus_type = rand() % 10 + 1;
+                    pItemGen.uEncantmentType = rand() % 10 + 1;
                 }
                 pItemsTable->SetSpecialBonus(&pItemGen);
                 pParty->SetHoldingItem(&pItemGen);
@@ -15742,7 +15742,7 @@
       v27 = &v0->pInventoryItems[pOut.z];
       v28 = v27->uItemID;
       v51 = pItemsTable->pItems[v27->uItemID].uEquipType;
-      v29 = (ItemGen *)(1800 * pParty->pPickedItem._bonus_type);
+      v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEncantmentType);
       if ( pParty->pPickedItem.uItemID != 233 )
       {
         if ( pParty->pPickedItem.uItemID == 236 )
@@ -15763,15 +15763,15 @@
             v33 = v27->uItemID;
             if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65
               || (pOut.y = v27->uAttributes, pOut.y & 2)
-              || v27->uAdditionalValue
-              || v27->_bonus_type
+              || v27->uSpecEnchantmentType
+              || v27->uEncantmentType
               || v51 && v51 != 1 && v51 != 2
               || (signed int)v33 >= 500 )
               goto LABEL_92;
             v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4];
             a2.y = (int)v29 << 7;
             v31 = (double)(signed int)((int)v29 << 7);
-            v27->uAdditionalValue = v34;
+            v27->uSpecEnchantmentType = v34;
           }
           else
           {
@@ -15779,13 +15779,13 @@
               || (v27->UpdateTempBonus(pParty->uTimePlayed), v30 = v27->uItemID, (signed int)v27->uItemID >= 64)
               && (signed int)v30 <= 65
               || (pOut.y = v27->uAttributes, pOut.y & 2)
-              || v27->uAdditionalValue
-              || v27->_bonus_type
+              || v27->uSpecEnchantmentType
+              || v27->uEncantmentType
               || v51 && v51 != 1 && v51 != 2
               || (signed int)v30 >= 500 )
               goto LABEL_92;
             a2.y = (int)v29 << 7;
-            v27->uAdditionalValue = 40;
+            v27->uSpecEnchantmentType = 40;
             v31 = (double)a2.y;
           }
           v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335);
@@ -15798,7 +15798,7 @@
         dword_50C9A8 = 256;
         goto LABEL_92;
       }
-      v36 = (70.0 - (double)pParty->pPickedItem._bonus_type) * 0.01;
+      v36 = (70.0 - (double)pParty->pPickedItem.uEncantmentType) * 0.01;
       if ( v36 < 0.0 )
         v36 = 0.0;
       if ( v51 != 12 )
@@ -15945,8 +15945,8 @@
                 *(int *)&v0->field_1F5[36 * v19 + 15] = 1;
               v20 = v47 + 50 * v15;
               v0->pInventoryItems[pOut.z].uItemID = v51;
-              v0->pInventoryItems[pOut.z]._bonus_type = (pParty->pPickedItem._bonus_type
-                                                       + v0->pInventoryItems[pOut.z]._bonus_type)
+              v0->pInventoryItems[pOut.z].uEncantmentType = (pParty->pPickedItem.uEncantmentType
+                                                       + v0->pInventoryItems[pOut.z].uEncantmentType)
                                                       / 2;
               v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168  + 388
 LABEL_74:
@@ -15963,7 +15963,7 @@
               if ( *(int *)(a2.y + 532) == 221 )
                 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID;
               else
-                *(int *)(a2.y + 536) = pParty->pPickedItem._bonus_type;
+                *(int *)(a2.y + 536) = pParty->pPickedItem.uEncantmentType;
               v21 = v0->AddItem(0xFFFFFFFFu, 0xDCu);
               if ( v21 )
                 *(int *)&v0->field_1F5[36 * v21 + 15] = 1;
--- a/mm7_6.cpp	Fri Feb 22 22:34:35 2013 +0200
+++ b/mm7_6.cpp	Fri Feb 22 22:36:31 2013 +0200
@@ -1402,7 +1402,7 @@
   {
     if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 )
       goto LABEL_9;
-    v14 = pActor->array_000234[3].uAdditionalValue;
+    v14 = pActor->array_000234[3].uSpecEnchantmentType;
     pActor->array_000234[3].Reset();
   }
   if ( v14 )
@@ -1432,7 +1432,7 @@
       v4 = Dst.uItemID;
     }
     if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
-      Dst._bonus_type = 2 * rand() % 4 + 2;
+      Dst.uEncantmentType = 2 * rand() % 4 + 2;
     pItemsTable->SetSpecialBonus(&Dst);
     if ( !pParty->AddItem(&Dst) )
       pParty->SetHoldingItem(&Dst);
@@ -4012,14 +4012,14 @@
         {
           if (!v730c->Broken())
           {
-            if ( v730c->uAdditionalValue == v1 )
+            if ( v730c->uSpecEnchantmentType == v1 )
             {
-              if ( v730c->_bonus_type == v1 )
+              if ( v730c->uEncantmentType == v1 )
               {
                 v68 = BYTE4(v726->pConditions[3]);
                 if ( !v68 || v68 == 1 || v68 == 2 )
                 {
-                  if ( !pItemsTable->_456D5E_is_some_material(v730c) )
+                  if ( !pItemsTable->IsMaterialNonCommon(v730c) )
                   {
                     v69 = v730c;
                     v14 = v731 == 4;
@@ -5421,8 +5421,8 @@
           {
             if ( v731 != 4
               || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134)
-              || v726->pInventoryItems[a2].uAdditionalValue != v1
-              || v726->pInventoryItems[a2]._bonus_type != v1
+              || v726->pInventoryItems[a2].uSpecEnchantmentType != v1
+              || v726->pInventoryItems[a2].uEncantmentType != v1
               || v726->pInventoryItems[a2]._bonus_strength != v1
               || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) )
               goto LABEL_616;
@@ -5526,8 +5526,8 @@
         v290 = v289->uItemID;
         LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4;
         if ( v290 > 134
-          || _this->uAdditionalValue != v1
-          || _this->_bonus_type != v1
+          || _this->uSpecEnchantmentType != v1
+          || _this->uEncantmentType != v1
           || _this->_bonus_strength != v1
           || (v291 = pItemsTable->pItems[v290].uEquipType) == 0
           || v291 == 1
@@ -5579,7 +5579,7 @@
           }
           v302 = rand() % SLODWORD(v725);
           v303 = v679;
-          v294->uAdditionalValue = v679;
+          v294->uSpecEnchantmentType = v679;
           v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
           v305 = v302 + 1;
           if ( v304 < v305 )
@@ -5589,26 +5589,26 @@
               v307 = (int)(jj + 1);
               v732 = v307;
               v308 = *(int *)v307;
-              v294->uAdditionalValue = v308;
+              v294->uSpecEnchantmentType = v308;
               v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
               if ( v304 >= v305 )
                 break;
             }
           }
-          ++v294->uAdditionalValue;
+          ++v294->uSpecEnchantmentType;
         }
         else
         {
           v293 = rand();
           v294 = _this;
           v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
-          _this->_bonus_type = 0;
+          _this->uEncantmentType = 0;
           for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
                 ;
-                kk += pItemsTable->pEnchantments[v294->_bonus_type].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
+                kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
                                                                          + 1] )
           {
-            ++v294->_bonus_type;
+            ++v294->uEncantmentType;
             if ( kk >= v295 )
               break;
           }
@@ -7335,7 +7335,7 @@
           || *(int *)(HIDWORD(v733) + 12) != v1
           || *(int *)(HIDWORD(v733) + 4) != v1
           || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2
-          || pItemsTable->_456D5E_is_some_material((ItemGen *)HIDWORD(v733)) )
+          || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) )
           goto LABEL_199;
         v592 = HIDWORD(v733);
         v14 = v731 == 4;