changeset 220:125354fe1b9f

Слияние
author Ritor1
date Sun, 17 Feb 2013 08:51:02 +0600
parents f7c268995788 (current diff) 335db7429f7c (diff)
children c122d90a620a
files mm7_3.cpp
diffstat 14 files changed, 568 insertions(+), 556 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Sun Feb 17 08:50:45 2013 +0600
+++ b/GUIWindow.h	Sun Feb 17 08:51:02 2013 +0600
@@ -298,7 +298,7 @@
   UIMSG_ToggleFlipOnExit = 0xE2,
   UIMSG_16F = 0x16F,
   UIMSG_170 = 0x170,
-  UIMSG_194 = 0x194,
+  UIMSG_Game_Action = 0x194,
   UIMSG_195 = 0x195,
   UIMSG_OpenRestUI = 0x199,
   UIMSG_19A = 0x19A,
--- a/Items.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/Items.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -1029,18 +1029,10 @@
         {
           switch ( v101 )
           {
-            case 2:
-              pItems[v35].field_2C = atoi(v36);
-              break;
-            case 3:
-              pItems[v35].field_2D = atoi(v36);
-              break;
-            case 4:
-              pItems[v35].field_2E = atoi(v36);
-              break;
-            case 5:
-              pItems[v35].field_2F = atoi(v36);
-              break;
+            case 2: pItems[v35].field_2C[0] = atoi(v36); break;
+            case 3: pItems[v35].field_2C[1] = atoi(v36); break;
+            case 4: pItems[v35].field_2C[2] = atoi(v36); break;
+            case 5: pItems[v35].field_2C[3] = atoi(v36); break;
             case 6:
               *((unsigned char *)&pItems[0].uItemID + 16 * (3 * v35 + 3)) = atoi(v36);
               break;
@@ -1073,7 +1065,7 @@
   }
   v39 = (char *)field_11684;
   memset(field_11684, 0, 0x18u);
-  v40 = &pItems[0].field_2C;
+  v40 = pItems[0].field_2C;
   v77 = 6;
   do
   {
@@ -1787,14 +1779,14 @@
 
 
 //----- (00456620) --------------------------------------------------------
-void ItemsTable::GenerateItem(int a2, int a3, ItemGen *pItem)
+void ItemsTable::GenerateItem(int a2, int a3, ItemGen *out_item)
 {
-  ItemGen *v4; // esi@1
-  ItemsTable *v5; // edi@1
+  //ItemGen *v4; // esi@1
+  //ItemsTable *v5; // edi@1
   int v6; // ebx@3
   int *v7; // ecx@33
-  int v8; // eax@34
-  int v9; // eax@39
+  //int v8; // eax@34
+  //int v9; // eax@39
   int v10; // ebx@43
   int v11; // ecx@47
   unsigned int *v12; // edx@48
@@ -1836,163 +1828,101 @@
   unsigned int v48; // ecx@123
   int v49; // eax@123
   int v50; // eax@123
-  unsigned char Dst[0xC80]; // [sp+Ch] [bp-C88h]@33
+  int Dst[800]; // [sp+Ch] [bp-C88h]@33
   int v52; // [sp+C8Ch] [bp-8h]@33
-  int v53; // [sp+C90h] [bp-4h]@1
+  //int v53; // [sp+C90h] [bp-4h]@1
   int v54; // [sp+C9Ch] [bp+8h]@3
-  int v55; // [sp+CA0h] [bp+Ch]@34
+  //int v55; // [sp+CA0h] [bp+Ch]@34
   signed int v56; // [sp+CA0h] [bp+Ch]@55
   int v57; // [sp+CA0h] [bp+Ch]@62
   int *v58; // [sp+CA0h] [bp+Ch]@102
   int v59; // [sp+CA0h] [bp+Ch]@123
-  signed int a2a; // [sp+CA4h] [bp+10h]@33
+  //signed int a2a; // [sp+CA4h] [bp+10h]@33
   int a2b; // [sp+CA4h] [bp+10h]@101
   int a2c; // [sp+CA4h] [bp+10h]@120
 
-  v53 = -1;
-  v4 = pItem;
-  v5 = this;
-  if ( !pItem )
-    v4 = (ItemGen *)pAllocator->AllocNamedChunk(pItem, 0x24u, "newItemGen");
-  memset(v4, 0, 0x24u);
+  //v53 = -1;
+  //v4 = pItem;
+  //v5 = this;
+  if ( !out_item )
+    out_item = (ItemGen *)pAllocator->AllocNamedChunk(out_item, sizeof(*out_item), "newItemGen");
+  memset(out_item, 0, sizeof(*out_item));
   v6 = a2 - 1;
   v54 = a2 - 1;
   if ( a3 )
   {
-    switch ( a3 )
+    ITEM_EQUIP_TYPE   requested_equip;
+    PLAYER_SKILL_TYPE requested_skill = PLAYER_SKILL_INVALID;
+    switch (a3)
     {
-      case 20:
-        a3 = EQUIP_ONE_OR_TWO_HANDS;
-        break;
-      case 21:
-        a3 = 3;
-        break;
-      case 22:
-        v53 = 38;
-        break;
-      case 23:
-        v53 = 1;
-        break;
-      case 24:
-        v53 = 2;
-        break;
-      case 25:
-        v53 = 3;
-        break;
-      case 26:
-        v53 = 4;
-        break;
-      case 27:
-        v53 = 5;
-        break;
-      case 28:
-        v53 = 6;
-        break;
-      case 30:
-        v53 = 0;
-        break;
-      case 31:
-        v53 = 9;
-        break;
-      case 32:
-        v53 = 10;
-        break;
-      case 33:
-        v53 = 0xBu;
-        break;
-      case 34:
-        a3 = 4;
-        break;
-      case 35:
-        a3 = 5;
-        break;
-      case 36:
-        a3 = 6;
-        break;
-      case 37:
-        a3 = 7;
-        break;
-      case 38:
-        a3 = 8;
-        break;
-      case 39:
-        a3 = EQUIP_BOOTS;
-        break;
-      case 40:
-        a3 = EQUIP_RING;
-        break;
-      case 41:
-        a3 = 0xBu;
-        break;
-      case 42:
-        a3 = EQUIP_C;
-        break;
-      case 43:
-        a3 = EQUIP_F;
-        break;
-      case 44:
-        a3 = EQUIP_POTION;
-        break;
-      case 45:
-        a3 = EQUIP_REAGENT;
-        break;
-      case 46:
-        a3 = EQUIP_GEM;
-        break;
-      case 29:
-        v53 = 37;
-        break;
+      case 20: requested_equip = EQUIP_ONE_OR_TWO_HANDS; break;
+      case 21: requested_equip = EQUIP_ARMOUR; break;
+      case 22: requested_skill = (PLAYER_SKILL_TYPE)38; __debugbreak();/*check this skill*/ break;
+      case 23: requested_skill = PLAYER_SKILL_SWORD; break;
+      case 24: requested_skill = PLAYER_SKILL_DAGGER; break;
+      case 25: requested_skill = PLAYER_SKILL_AXE; break;
+      case 26: requested_skill = PLAYER_SKILL_SPEAR; break;
+      case 27: requested_skill = PLAYER_SKILL_BOW; break;
+      case 28: requested_skill = PLAYER_SKILL_MACE; break;
+      case 29: requested_skill = (PLAYER_SKILL_TYPE)37; __debugbreak();/*check this skill*/break;
+      case 30: requested_skill = PLAYER_SKILL_STAFF; break;
+      case 31: requested_skill = PLAYER_SKILL_LEATHER; break;
+      case 32: requested_skill = PLAYER_SKILL_CHAIN; break;
+      case 33: requested_skill = PLAYER_SKILL_PLATE; break;
+      case 34: requested_equip = EQUIP_SHIELD; break;
+      case 35: requested_equip = EQUIP_HELMET; break;
+      case 36: requested_equip = EQUIP_BELT; break;
+      case 37: requested_equip = EQUIP_CLOAK; break;
+      case 38: requested_equip = EQUIP_GAUNTLETS; break;
+      case 39: requested_equip = EQUIP_BOOTS; break;
+      case 40: requested_equip = EQUIP_RING; break;
+      case 41: requested_equip = EQUIP_AMULET; break;
+      case 42: requested_equip = EQUIP_C; break;
+      case 43: requested_equip = EQUIP_F; break;
+      case 44: requested_equip = EQUIP_POTION; break;
+      case 45: requested_equip = EQUIP_REAGENT; break;
+      case 46: requested_equip = EQUIP_GEM; break;
       default:
-        --a3;
+        __debugbreak(); // check this condition
+        requested_equip = (ITEM_EQUIP_TYPE)(a3 - 1);
         break;
     }
-    memset(&Dst, 0, 0xC80u);
+
+    memset(Dst, 0, sizeof(Dst));
+
     v52 = 0;
-    v7 = (int *)&Dst;
-    a2a = 1;
-    if ( v53 == -1 )
+    v7 = Dst;
+
+    if (requested_skill == PLAYER_SKILL_INVALID)
     {
-      v53 = (int)&v5->pItems[1].uEquipType;
-      v9 = (int)(&v5->pItems[1].field_2C + v6);
-      do
+      for (uint i = 1; i < 500; ++i)
       {
-        if ( *(unsigned char *)v53 == a3 )
+        if (pItems[i].uEquipType == requested_equip)
         {
-          *v7 = a2a;
-          ++v7;
-          v52 += *(unsigned char *)v9;
+          *v7++ = i;
+          v52 += pItems[i].field_2C[v6];
         }
-        ++a2a;
-        v53 += 48;
-        v9 += 48;
       }
-      while ( a2a < 500 );
     }
     else
     {
-      v55 = (int)&v5->pItems[1].uSkillType;
-      v8 = (int)(&v5->pItems[1].field_2C + v6);
-      do
+      for (uint i = 1; i < 500; ++i)
       {
-        if ( *(unsigned char *)v55 == v53 )
+        if (pItems[i].uSkillType == requested_skill)
         {
-          *v7 = a2a;
-          ++v7;
-          v52 += *(unsigned char *)v8;
+          *v7++ = i;
+          v52 += pItems[i].field_2C[v6];
         }
-        ++a2a;
-        v55 += 48;
-        v8 += 48;
       }
-      while ( a2a < 500 );
     }
+
     v10 = 0;
     if ( v52 )
       v10 = rand() % v52;
-    v4->uItemID = *(uint *)Dst;
-    if ( !Dst )
-      v4->uItemID = 1;
-    v11 = *(&v5->pItems[v4->uItemID].field_2C + v54);
+    out_item->uItemID = *Dst;
+    if ( !*Dst )
+      out_item->uItemID = 1;
+    v11 = pItems[out_item->uItemID].field_2C[v54];
     if ( v11 < v10 )
     {
       v12 = (uint *)Dst;
@@ -2000,24 +1930,24 @@
       {
         ++v12;
         v13 = *v12;
-        v4->uItemID = *v12;
-        v11 += *(&v5->pItems[v13].field_2C + v54);
+        out_item->uItemID = *v12;
+        v11 += pItems[v13].field_2C[v54];
       }
       while ( v11 < v10 );
     }
-    if ( v5->pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE )
+    if (pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE)
     {
-      v4->_bonus_type = 0;
+      out_item->_bonus_type = 0;
       v14 = 2;
       do
       {
-        v4->_bonus_type += rand() % 4 + 1;
-        v15 = v4->_bonus_type;
+        out_item->_bonus_type += rand() % 4 + 1;
+        v15 = out_item->_bonus_type;
         --v14;
       }
       while ( v14 );
 LABEL_72:
-      v4->_bonus_type = v15 * (v54 + 1);
+      out_item->_bonus_type = v15 * (v54 + 1);
       goto LABEL_73;
     }
   }
@@ -2032,32 +1962,32 @@
     if ( v54 == 5 && rand() % 100 < 5 && !pParty->field_7BA[v17] && v56 < 13 )
     {
       pParty->field_7BA[v17] = 1;
-      v4->uAttributes = 0;
-      v4->uItemID = v17 + 500;
-      v5->SetSpecialBonus(v4);
+      out_item->uAttributes = 0;
+      out_item->uItemID = v17 + 500;
+      SetSpecialBonus(out_item);
       return;
     }
     v57 = 0;
-    v18 = rand() % v5->field_11684[v54];
-    v4->uItemID = 0;
+    v18 = rand() % field_11684[v54];
+    out_item->uItemID = 0;
     if ( v18 > 0 )
     {
       do
-        v57 += *(&v5->pItems[v4->uItemID++ + 1].field_2C + v54);
+        v57 += pItems[out_item->uItemID++ + 1].field_2C[v54];
       while ( v57 < v18 );
     }
     if ( !v18 )
-      v4->uItemID = 1;
-    if ( !v4->uItemID )
-      v4->uItemID = 1;
-    if ( v5->pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE )
+      out_item->uItemID = 1;
+    if ( !out_item->uItemID )
+      out_item->uItemID = 1;
+    if ( pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
     {
-      v4->_bonus_type = 0;
+      out_item->_bonus_type = 0;
       v19 = 2;
       do
       {
-        v4->_bonus_type += rand() % 4 + 1;
-        v15 = v4->_bonus_type;
+        out_item->_bonus_type += rand() % 4 + 1;
+        v15 = out_item->_bonus_type;
         --v19;
       }
       while ( v19 );
@@ -2065,22 +1995,22 @@
     }
   }
 LABEL_73:
-  if ( v4->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
+  if (out_item->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
     && !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
-    v4->uItemID = ITEM_SPELLBOOK_LIGHT_SUN_BURST;
-  if ( BYTE2(pItemsTable->pItems[v4->uItemID + 1].uItemID) )
-    v4->uAttributes = 0;
+    out_item->uItemID = ITEM_SPELLBOOK_LIGHT_SUN_BURST;
+  if ( BYTE2(pItems[out_item->uItemID + 1].uItemID) )
+    out_item->uAttributes = 0;
   else
-    v4->uAttributes = 1;
-  if ( v5->pItems[v4->uItemID].uEquipType != EQUIP_POTION )
+    out_item->uAttributes = 1;
+  if (pItems[out_item->uItemID].uEquipType != EQUIP_POTION )
   {
-    v4->uAdditionalValue = 0;
-    v4->_bonus_type = 0;
+    out_item->uAdditionalValue = 0;
+    out_item->_bonus_type = 0;
   }
-  v20 = v5->pItems[v4->uItemID].uEquipType;
+  v20 = pItems[out_item->uItemID].uEquipType;
   if ( v20 <= EQUIP_BOW )
   {
-    v37 = (int)&v5->field_1169C[4 * v54 + 48];
+    v37 = (int)&field_1169C[4 * v54 + 48];
     if ( !*(unsigned int *)v37 )
       return;
     v38 = rand() % 100;
@@ -2093,13 +2023,13 @@
     {
       if ( v20 == EQUIP_C )
       {
-        v21 = rand() % 6 + pItemsTable->pItems[v4->uItemID].uDamageMod + 1;
-        v4->uNumCharges = v21;
-        v4->uMaxCharges = v21;
+        v21 = rand() % 6 + pItems[out_item->uItemID].uDamageMod + 1;
+        out_item->uNumCharges = v21;
+        out_item->uMaxCharges = v21;
       }
       return;
     }
-    v22 = (int)&v5->field_1169C[4 * v54];
+    v22 = (int)&field_1169C[4 * v54];
     if ( !*(unsigned int *)v22 )
       return;
     v23 = rand();
@@ -2107,34 +2037,34 @@
     v25 = v23 % 100;
     if ( v23 % 100 < v24 )
       goto LABEL_127;
-    if ( !*(unsigned int *)&v5->field_1169C[4 * v54 + 24] )
+    if ( !*(unsigned int *)&field_1169C[4 * v54 + 24] )
       return;
     if ( v25 < v24 )
     {
 LABEL_127:
-      v26 = rand() % v5->field_116D8[v5->pItems[v4->uItemID].uEquipType];
-      v27 = v4->uItemID;
-      v4->_bonus_type = 0;
-      for ( i = v5->pEnchantments[0].field_8[v5->pItems[v27].uEquipType + 1];
+      v26 = rand() % field_116D8[pItems[out_item->uItemID].uEquipType];
+      v27 = out_item->uItemID;
+      out_item->_bonus_type = 0;
+      for ( i = pEnchantments[0].field_8[pItems[v27].uEquipType + 1];
             i < v26;
-            i += v5->pEnchantments[v4->_bonus_type].field_8[v5->pItems[v29].uEquipType + 1] )
+            i += pEnchantments[out_item->_bonus_type].field_8[pItems[v29].uEquipType + 1] )
       {
-        v29 = v4->uItemID;
-        ++v4->_bonus_type;
+        v29 = out_item->uItemID;
+        ++out_item->_bonus_type;
       }
-      ++v4->_bonus_type;
-      v30 = v5->field_116D8[2 * v54 + 12];
+      ++out_item->_bonus_type;
+      v30 = field_116D8[2 * v54 + 12];
       v31 = rand();
-      v32 = v4->_bonus_type - 1;
-      v33 = v31 % (v5->field_116D8[2 * v54 + 13] - v30 + 1) + v30;
-      v4->_bonus_strength = v33;
+      v32 = out_item->_bonus_type - 1;
+      v33 = v31 % (field_116D8[2 * v54 + 13] - v30 + 1) + v30;
+      out_item->_bonus_strength = v33;
       if ( v32 == 21 || v32 == 22 || v32 == 23 )
-        v4->_bonus_strength = v33 >> 1;
-      if ( v4->_bonus_strength <= 0 )
-        v4->_bonus_strength = 1;
+        out_item->_bonus_strength = v33 >> 1;
+      if ( out_item->_bonus_strength <= 0 )
+        out_item->_bonus_strength = 1;
       return;
     }
-    v34 = v24 + *(unsigned int *)&v5->field_1169C[4 * v54 + 24];
+    v34 = v24 + *(unsigned int *)&field_1169C[4 * v54 + 24];
     v36 = __OFSUB__(v25, v34);
     v35 = v25 - v34 < 0;
   }
@@ -2143,11 +2073,11 @@
   memset(&Dst, 0, 0xC80u);
   v39 = 0;
   a2b = 0;
-  if ( v5->field_11798 > 0 )
+  if ( field_11798 > 0 )
   {
-    v52 = -16 - (uint)v5;
+    v52 = -16 - (uint)this;
     v58 = (int *)&Dst;
-    v40 = (int)&v5->pSpecialEnchantments[1];
+    v40 = (int)&pSpecialEnchantments[1];
     do
     {
       switch ( v54 )
@@ -2162,8 +2092,8 @@
           if ( !*(unsigned char *)v40 || v43 == 1 )
           {
 LABEL_117:
-            v39 += *((unsigned char *)&v5->pItems[0].uItemID + v40 + v52 + v5->pItems[v4->uItemID].uEquipType);
-            if ( *((unsigned char *)&v5->pItems[0].uItemID + v40 + v52 + v5->pItems[v4->uItemID].uEquipType) )
+            v39 += *((unsigned char *)&pItems[0].uItemID + v40 + v52 + pItems[out_item->uItemID].uEquipType);
+            if ( *((unsigned char *)&pItems[0].uItemID + v40 + v52 + pItems[out_item->uItemID].uEquipType) )
             {
               v44 = v58;
               ++v58;
@@ -2191,27 +2121,27 @@
       ++a2b;
       v40 += 28;
     }
-    while ( a2b < v5->field_11798 );
+    while ( a2b < field_11798 );
   }
   v45 = rand();
-  v4->uAdditionalValue = *(uint *)Dst;
+  out_item->uAdditionalValue = *Dst;
   v46 = v45 % v39 + 1;
-  a2c = *((unsigned char *)&v5->pItems[0].uItemID + 28 * (*(uint *)Dst + 1389) + v5->pItems[v4->uItemID].uEquipType);
+  a2c = *((unsigned char *)&pItems[0].uItemID + 28 * (*(uint *)Dst + 1389) + pItems[out_item->uItemID].uEquipType);
   if ( a2c < v46 )
   {
     for ( j = (int *)&Dst; ; j = (int *)v59 )
     {
-      v48 = v4->uItemID;
+      v48 = out_item->uItemID;
       v49 = (int)(j + 1);
       v59 = v49;
       v50 = *(unsigned int *)v49;
-      v4->uAdditionalValue = v50;
-      a2c += *((unsigned char *)&v5->pItems[0].uItemID + 28 * (v50 + 1389) + v5->pItems[v48].uEquipType);
+      out_item->uAdditionalValue = v50;
+      a2c += *((unsigned char *)&pItems[0].uItemID + 28 * (v50 + 1389) + pItems[v48].uEquipType);
       if ( a2c >= v46 )
         break;
     }
   }
-  ++v4->uAdditionalValue;
+  ++out_item->uAdditionalValue;
 }
 
 //----- (004505CC) --------------------------------------------------------
--- a/Items.h	Sun Feb 17 08:50:45 2013 +0600
+++ b/Items.h	Sun Feb 17 08:51:02 2013 +0600
@@ -72,7 +72,7 @@
   EQUIP_BOOTS = 0x9,
   EQUIP_RING = 0xA,
   EQUIP_AMULET = 0xB,
-  EQUIP_C = 0xC,
+  EQUIP_C = 0xC,      // wand?
   EQUIP_REAGENT = 0xD,
   EQUIP_POTION = 0xE,
   EQUIP_F = 0xF,
@@ -146,10 +146,7 @@
   char field_29;
   char field_2A;
   char field_2B;
-  char field_2C;
-  char field_2D;
-  char field_2E;
-  char field_2F;
+  char field_2C[4];
 };
 #pragma pack(pop)
 
--- a/Party.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/Party.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -71,12 +71,9 @@
 //----- (004936E1) --------------------------------------------------------
 void Party::SetHoldingItem(ItemGen *pItem)
 {
-  Party *v2; // esi@1
-
-  v2 = this;
   sub_421B2C_PlaceInInventory_or_DropPickedItem();
-  memcpy(&v2->pPickedItem, pItem, sizeof(v2->pPickedItem));
-  pMouse->SetCursorBitmapFromItemID(v2->pPickedItem.uItemID);
+  memcpy(&pPickedItem, pItem, sizeof(pPickedItem));
+  pMouse->SetCursorBitmapFromItemID(pPickedItem.uItemID);
 }
 
 //----- (0049370F) --------------------------------------------------------
--- a/Player.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/Player.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -576,7 +576,7 @@
   //Player *pPlayer; // edi@1
   //int v4; // eax@4
   signed int v5; // esi@4
-  char *v6; // ebx@4
+  unsigned char *v6; // ebx@4
   signed int v7; // ecx@5
   unsigned __int8 v8; // al@6
   int v9; // eax@10
@@ -608,8 +608,8 @@
   //v4 = a2;//102
   v5 = 0;
   pSoundId = 0;
-  v6 = (char *)&SoundSetAction[4 * speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ???
-  if ( uVoicesVolumeMultiplier )
+  v6 = SoundSetAction[speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ???
+  if (uVoicesVolumeMultiplier)
   {
     v7 = 0;
     do
@@ -625,17 +625,16 @@
       v9 = rand();
       //pVoiceID = uVoiceID;
       v11 = v20[v9 % v5];
-      if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID]) )
-      {
-        pSoundId = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID])
-            + 2 * (v11 + 50 * uVoiceID)
-            + 4998;
-        v12 = 8 * pPlayerNum + 312;
-        LOBYTE(v12) = v12 | OBJECT_Player;
+
+      if (int _v1 = byte_4ECF08[v11 - 1][uVoiceID])
+      {
+        pSoundId = rand() % _v1 + 2 * (v11 + 50 * uVoiceID) + 4998;
+        v12 = (8 * pPlayerNum + 312) | OBJECT_Player;
         pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0), 0);
       }
     }
   }
+
   v13 = 0;
   v14 = (int)(v6 + 3);
   do
@@ -1374,7 +1373,7 @@
 
   v11 = this;
   v3 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE);
-  v4 = (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0);
+  v4 = (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0);
   v5 = GetSizeInInventorySlots(v3 != -1 ? pIcons_LOD->pTextures[v3].uTextureWidth : 24);
   uItemIDa = GetSizeInInventorySlots(v4->uTextureHeight);
   if ( !areWeLoadingTexture )
@@ -1463,7 +1462,7 @@
   if ( v12 == -1 )
   {
     if ( uActiveCharacter )
-      pPlayers[uActiveCharacter]->PlaySound(SPEECH_15, 0);
+      pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
     result = 0;
   }
   else
--- a/Player.h	Sun Feb 17 08:50:45 2013 +0600
+++ b/Player.h	Sun Feb 17 08:51:02 2013 +0600
@@ -24,14 +24,14 @@
   SPEECH_11 = 11,
   SPEECH_12 = 12,
   SPEECH_14 = 14,
-  SPEECH_15 = 15,
+  SPEECH_NoRoom = 15,  // when placing to inventory
   SPEECH_16 = 16,
   SPEECH_17 = 17,
   SPEECH_18 = 18,
   SPEECH_19 = 19,
   SPEECH_20 = 20,
   SPEECH_21 = 21,
-  SPEECH_GoodDay = 22,
+  SPEECH_GoodDay = 22,     // greets on dialogue start
   SPEECH_GoodEvening = 23,
   SPEECH_24 = 24,
   SPEECH_25 = 25,
@@ -215,6 +215,8 @@
   PLAYER_SKILL_STEALING = 34,
   PLAYER_SKILL_ALCHEMY = 35,
   PLAYER_SKILL_LEARNING = 36,
+
+  PLAYER_SKILL_INVALID = -1
 };
 
 /*  329 */
--- a/SaveLoad.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/SaveLoad.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -67,18 +67,18 @@
     }
 
 
-  if (byte_4ED498)
+  if (SoundSetAction[24][0])
     for (uint i = 0; i < 4; ++i)
     {
       for (uint j = 0; j < pSoundList->uNumSounds; ++j)
-        if (pSoundList->pSounds[j].uSoundID == 2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4998)
+        if (pSoundList->pSounds[j].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998)
         {
           pSoundList->_4A9DCD(j, 1);
           break;
         }
 
         for (uint j = 0; j < pSoundList->uNumSounds; ++j)
-        if (pSoundList->pSounds[j].uSoundID == 2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4999)
+        if (pSoundList->pSounds[j].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999)
         {
           pSoundList->_4A9DCD(j, 1);
           break;
--- a/mm7_1.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_1.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -3432,6 +3432,7 @@
   a4 = (char *)v106.uViewportY;
   if ( v119 )
   {
+    __debugbreak(); // following format strings are decompiled incorrectly
     sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP);
     a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
     a4 = &a4[LOBYTE(v56->uFontHeight) - 3];
@@ -3442,6 +3443,7 @@
   }
   else
   {
+    __debugbreak(); // following format strings are decompiled incorrectly
     sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);
     a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
     v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630];
@@ -3466,6 +3468,7 @@
   v105 = pGlobalTXT_LocalizationStrings[54];
   if ( v116 )
   {
+    __debugbreak(); // following format strings are decompiled incorrectly
     sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[18], 0, (&v95)[4 * v121->pMonsterInfo.uAttack1Type]);
     a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
     a4 = &a4[LOBYTE(v56->uFontHeight) - 3];
@@ -3490,6 +3493,7 @@
   }
   else
   {
+    __debugbreak(); // following format strings are decompiled incorrectly
     sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]);
     a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
     a4 = &a4[LOBYTE(v56->uFontHeight) - 3];
@@ -3597,7 +3601,8 @@
     i = 0;
     do
     {
-      sprintf(pTmpBuf, "%s", (&v85)[4 * i], 0, pGlobalTXT_LocalizationStrings[630]);
+      __debugbreak(); // string argument is decompiled incorrectry
+      sprintf(pTmpBuf, "%s", (&v85)[4 * i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
       a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0);
       v65 = LOBYTE(v56->uFontHeight);
       ++i;
@@ -4090,7 +4095,7 @@
     if ( v22 == v5 )
     {
       if ( uActiveCharacter )
-        pPlayers[uActiveCharacter]->PlaySound(SPEECH_15, 0);
+        pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
       return 0;
     }
     v7 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
@@ -5729,46 +5734,46 @@
 //----- (00421D00) --------------------------------------------------------
 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID)
 {
-  unsigned int v1; // esi@1
-  int v2; // eax@2
-  Player *v3; // ecx@2
-  Player *v4; // ecx@5
+  //unsigned int v1; // esi@1
+  //int v2; // eax@2
+  //Player *v3; // ecx@2
+  //Player *v4; // ecx@5
   unsigned int v5; // [sp-4h] [bp-10h]@21
 
-  v1 = uPlayerID;
-  if ( pParty->pPickedItem.uItemID )
-  {
-    v2 = pPlayers[uPlayerID]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID);
-    v3 = pPlayers[v1];
-    if ( v2 )
-    {
-      memcpy(&v3->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5], &pParty->pPickedItem, 0x24u);
-      viewparams->bRedrawGameUI = 1;
+  //v1 = uPlayerID;
+  auto player = &pParty->pPlayers[uPlayerID - 1];
+  if (pParty->pPickedItem.uItemID)
+  {
+    //v3 = player;
+    if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID))
+    {
+      __debugbreak(); // invalid inventory indexing
+      memcpy(&player->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * slot + 5], &pParty->pPickedItem, 0x24u);
+      viewparams->bRedrawGameUI = true;
       pMouse->RemoveHoldingItem();
       return;
     }
-    if ( v3->CanAct() )
-    {
-      v4 = pPlayers[v1];
-    }
-    else
-    {
-      if ( !pPlayers[uActiveCharacter]->CanAct() )
+
+    if (!player->CanAct())
+    {
+      if ( pPlayers[uActiveCharacter]->CanAct())
         goto LABEL_9;
-      v4 = pPlayers[uActiveCharacter];
-    }
-    v4->PlaySound(SPEECH_15, 0);
-  }
+      player = pPlayers[uActiveCharacter];
+    }
+    player->PlaySound(SPEECH_NoRoom, 0);
+  }
+
 LABEL_9:
-  if ( !pCurrentScreen )
-  {
-    viewparams->bRedrawGameUI = 1;
-    if ( uActiveCharacter != v1 )
+  if (pCurrentScreen == SCREEN_GAME)
+  {
+    viewparams->bRedrawGameUI = true;
+    if ( uActiveCharacter != uPlayerID )
       //goto LABEL_27;
     {
-      if ( pPlayers[v1]->uTimeToRecovery )
+      if ( pPlayers[uPlayerID]->uTimeToRecovery )
         return;
-      uActiveCharacter = v1;
+
+      uActiveCharacter = uPlayerID;
       return;
     }
     v5 = 7;
@@ -5781,20 +5786,20 @@
   if ( pCurrentScreen == SCREEN_CHEST )
   {
 //LABEL_23:
-    viewparams->bRedrawGameUI = 1;
-    if ( uActiveCharacter == v1 )
+    viewparams->bRedrawGameUI = true;
+    if ( uActiveCharacter == uPlayerID )
     {
       pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
       pCurrentScreen = SCREEN_F;
       //goto LABEL_28;
-      uActiveCharacter = v1;
+      uActiveCharacter = uPlayerID;
       return;
     }
 //LABEL_27:
-    if ( pPlayers[v1]->uTimeToRecovery )
+    if ( pPlayers[uPlayerID]->uTimeToRecovery )
       return;
     //goto LABEL_28;
-    uActiveCharacter = v1;
+    uActiveCharacter = uPlayerID;
     return;
   }
   if ( pCurrentScreen != SCREEN_HOUSE )
@@ -5802,40 +5807,40 @@
     if ( pCurrentScreen == SCREEN_E )
     {
 //LABEL_28:
-      uActiveCharacter = v1;
+      uActiveCharacter = uPlayerID;
       return;
     }
     if ( pCurrentScreen != SCREEN_F )
     {
-      viewparams->bRedrawGameUI = 1;
-      uActiveCharacter = v1;
+      viewparams->bRedrawGameUI = true;
+      uActiveCharacter = uPlayerID;
       if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 )
         sub_419100();
       return;
     }
     //goto LABEL_23;
-    viewparams->bRedrawGameUI = 1;
-    if ( uActiveCharacter == v1 )
+    viewparams->bRedrawGameUI = true;
+    if ( uActiveCharacter == uPlayerID )
     {
       pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
       pCurrentScreen = SCREEN_F;
       //goto LABEL_28;
-      uActiveCharacter = v1;
+      uActiveCharacter = uPlayerID;
       return;
     }
 //LABEL_27:
-    if ( pPlayers[v1]->uTimeToRecovery )
+    if ( pPlayers[uPlayerID]->uTimeToRecovery )
       return;
     //goto LABEL_28;
-    uActiveCharacter = v1;
+    uActiveCharacter = uPlayerID;
     return;
   }
   if ( ptr_507BC0->field_40 == 1 )
     return;
-  viewparams->bRedrawGameUI = 1;
-  if ( uActiveCharacter != v1 )
+  viewparams->bRedrawGameUI = true;
+  if ( uActiveCharacter != uPlayerID )
     //goto LABEL_28;
-    uActiveCharacter = v1;
+    uActiveCharacter = uPlayerID;
     return;
   if ( dword_F8B19C == 2 || dword_F8B19C == 6 )
   {
--- a/mm7_2.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_2.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -4599,7 +4599,7 @@
       memcpy(&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v25 + 5], v20, 0x24u);
       goto LABEL_42;
     }
-    v0->PlaySound(SPEECH_15, 0);
+    v0->PlaySound(SPEECH_NoRoom, 0);
     v54 = 5;
 LABEL_70:
     v9 = pGlobalTXT_LocalizationStrings[563];   // "Pack is Full!"
@@ -4694,7 +4694,7 @@
       v27->PlaySound((PlayerSpeech)v51, v53);
       return;
     }
-    v0->PlaySound(SPEECH_15, 0);
+    v0->PlaySound(SPEECH_NoRoom, 0);
     v54 = 2;
     goto LABEL_70;
   }
@@ -13028,6 +13028,9 @@
   }
 }
 
+
+
+
 //----- (004651F4) --------------------------------------------------------
 bool MM7_Initialize()
 {
@@ -13047,7 +13050,6 @@
   }
 
 
-
   srand(GetTickCount());
   /*GetDiskFreeSpaceA(0, &SectorsPerCluster, &BytesPerSector, &hdc, &TotalNumberOfClusters);
   v4 = hdc * BytesPerSector * SectorsPerCluster;
@@ -13535,19 +13537,6 @@
       sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
       remove(pTmpBuf);
     }
-  /*do
-  {
-    v11 = 1;
-    do
-    {
-      sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11);
-      remove(pTmpBuf);
-      ++v11;
-    }
-    while ( v11 < 6 );
-    ++v10;
-  }
-  while ( v10 < 5 );*/
 
   Initialize_GamesLOD_NewLOD();
   dword_576E2C = 512;
--- a/mm7_3.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_3.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -16424,19 +16424,8 @@
   GUIButton *v14; // eax@43
   GUIButton *v15; // edi@43
   signed int v16; // eax@44
-  int v17; // eax@46
-  int v18; // eax@47
-  int v19; // eax@48
-  int v20; // eax@49
-  int v21; // eax@50
-  int v22; // eax@51
   unsigned int v23; // eax@53
   const char *v24; // eax@59
-  int v25; // eax@65
-  int v26; // eax@66
-  int v27; // eax@67
-  int v28; // eax@68
-  int v29; // eax@69
   unsigned __int16 v30; // cx@83
   int v31; // ecx@86
   int v32; // ebx@93
@@ -16509,9 +16498,8 @@
       pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428);
       v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0);
       pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-    if ( uDialogueType == DIALOGUE_ARENA_REWARD )
+    }
+    else if ( uDialogueType == DIALOGUE_ARENA_REWARD )
     {
       sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
       pInString = v4;
@@ -16529,9 +16517,8 @@
       pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
       v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-    if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
+    }
+    else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
     {
       pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
       pWindow.uFrameWidth = 460;
@@ -16548,7 +16535,6 @@
       pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
       v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
     }
   }
   else
@@ -16571,9 +16557,8 @@
       pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
       v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-    if ( uDialogueType == DIALOGUE_13 )
+    }
+    else if ( uDialogueType == DIALOGUE_13 )
     {
       v5 = 5 * pNPC->uProfession;
       v6 = (char *)*(&pNPCStats->field_13A64 + v5);
@@ -16593,14 +16578,11 @@
       pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
       v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-    if ( (signed int)uDialogueType > DIALOGUE_18 )
-    {
-      if ( (signed int)uDialogueType > DIALOGUE_24 )
-      {
-        if ( uDialogueType == DIALOGUE_77 )
-        {
+    }
+    else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_77 || byte_5B0938[0]) )
+    {
+      if ( (signed int)uDialogueType > DIALOGUE_24 && uDialogueType == DIALOGUE_77 )
+      {
           v5 = 5 * pNPC->uProfession;
           if ( byte_F8B1EC )
           {
@@ -16621,9 +16603,8 @@
             pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
             v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
             pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-            goto LABEL_42;
-          }
-          if ( pNPC->uFlags & 0x80 )
+          }
+          else if ( pNPC->uFlags & 0x80 )
           {
             v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession);
             v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
@@ -16642,92 +16623,106 @@
             pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
             v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
             pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-            goto LABEL_42;
-          }
-          v6 = (char *)*(&pNPCStats->field_13A64 + v5);
-          v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
-          pInString = v7;
-          pWindow.uFrameWidth = 460;
-          pWindow.uFrameZ = 452;
-          pOutString = pFontArrus;
-          v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-          if ( 352 - v12 < 8 )
-          {
-            pOutString = pFontCreate;
-            v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-          }
-          pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
-                                     (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
-          pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
-          v13 = FitTextInAWindow(pInString, pOutString,  &pWindow, 0xDu, 0);
-          pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-          goto LABEL_42;
-        }
-        goto LABEL_24;
-      }
-      if ( byte_5B0938[0] )
-        goto LABEL_24;
-      v7 = (char *)ptr_F8B1E8;
-      pInString = v7;
-      pWindow.uFrameWidth = 460;
-      pWindow.uFrameZ = 452;
-      pOutString = pFontArrus;
-      v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-      if ( 352 - v12 < 8 )
-      {
-        pOutString = pFontCreate;
-        v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-      }
-      pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
-        (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
-      pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
-      v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
-      pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-  }
-LABEL_24:
-  if ( *(int *)v54 == 1 )
-  {
-    v11 = pNPC->greet;
-    v8 = 0;
-    if ( v11 )
-    {
-      v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11);
-      goto LABEL_32;
-    }
-  }
-  else
-  {
-    if ( *(int *)v54 == 2 )
-    {
-      if ( pNPC->uFlags & 0x80 )
-        v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
-      else
-        v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
-       pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
-LABEL_32:
-
-      if (  pInString == NULL )
-        goto LABEL_42;
-      pWindow.uFrameWidth = 460;
-      pWindow.uFrameZ = 452;
-      pOutString = pFontArrus;
-      v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-      if ( 352 - v12 < 8 )
-      {
-        pOutString = pFontCreate;
-        v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
-      }
-      pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
-        (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
-      pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
-      v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
-      pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
-      goto LABEL_42;
-    }
-  }
-LABEL_42:
+          }
+		  else
+		  {
+			v6 = (char *)*(&pNPCStats->field_13A64 + v5);
+			v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
+			pInString = v7;
+			pWindow.uFrameWidth = 460;
+			pWindow.uFrameZ = 452;
+			pOutString = pFontArrus;
+			v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+			if ( 352 - v12 < 8 )
+			{
+			pOutString = pFontCreate;
+			v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+			}
+			pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
+										(uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
+			pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
+			v13 = FitTextInAWindow(pInString, pOutString,  &pWindow, 0xDu, 0);
+			pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
+		  }
+      }
+	  else
+	  {
+		  v7 = (char *)ptr_F8B1E8;
+		  pInString = v7;
+		  pWindow.uFrameWidth = 460;
+		  pWindow.uFrameZ = 452;
+		  pOutString = pFontArrus;
+		  v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+		  if ( 352 - v12 < 8 )
+		  {
+			pOutString = pFontCreate;
+			v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+		  }
+		  pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
+			(uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
+		  pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
+		  v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
+		  pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
+	  }
+    }
+	else
+	{    
+		if ( *(int *)v54 == 1 )
+		{
+			v11 = pNPC->greet;
+			v8 = 0;
+			if ( v11 )
+			{
+				v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11);
+				if (  pInString != NULL )
+				{
+					pWindow.uFrameWidth = 460;
+					pWindow.uFrameZ = 452;
+					pOutString = pFontArrus;
+					v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+					if ( 352 - v12 < 8 )
+					{
+						pOutString = pFontCreate;
+						v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+					}
+					pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
+					(uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
+					pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
+					v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
+					pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
+				}
+			}
+		}
+		else
+		{
+			if ( *(int *)v54 == 2 )
+			{
+				if ( pNPC->uFlags & 0x80 )
+					v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
+				else
+					v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
+				pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
+				if (  pInString != NULL )
+				{
+					pWindow.uFrameWidth = 460;
+					pWindow.uFrameZ = 452;
+					pOutString = pFontArrus;
+					v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+					if ( 352 - v12 < 8 )
+					{
+						pOutString = pFontCreate;
+						v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
+					}
+					pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
+					(uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
+					pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
+					v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
+					pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
+				}
+			}
+		}
+	}
+  }
   memcpy(&v52, pDialogueWindow, sizeof(v52));
   v52.uFrameX = 483;
   v52.uFrameWidth = 148;
@@ -16741,125 +16736,107 @@
     if ( !v14 )
       break;
     v16 = v14->uControlParam;
-    if ( v16 > 24 )
-    {
-      v25 = v16 - 76;
-      if ( v25 )
-      {
-        v26 = v25 - 1;
-        if ( v26 )
-        {
-          v27 = v26 - 8;
-          if ( v27 )
-          {
-            v28 = v27 - 1;
-            if ( v28 )
-            {
-              v29 = v28 - 1;
-              if ( v29 )
-              {
-                if ( v29 != 1 )
-                {
-                  v24 = "";
-                  goto LABEL_79;
-                }
-                v24 = pGlobalTXT_LocalizationStrings[581];
-              }
-              else
-              {
-                v24 = pGlobalTXT_LocalizationStrings[580];
-              }
-            }
-            else
-            {
-              v24 = pGlobalTXT_LocalizationStrings[579];
-            }
-          }
-          else
-          {
-            v24 = pGlobalTXT_LocalizationStrings[578];
-          }
-        }
-        else
-        {
-          v24 = pGlobalTXT_LocalizationStrings[407];
-        }
-      }
-      else
-      {
-        if ( pNPC->uFlags & 0x80 )
-        {
-          sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName);
-          v24 = pTmpBuf;
-          goto LABEL_79;
-        }
-        v24 = pGlobalTXT_LocalizationStrings[406];
-      }
-    }
-    else
-    {
-      if ( v16 == 24 )
-      {
-        v23 = pNPC->evtf;
-LABEL_63:
-        v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
-        if ( !v24 )
-        {
-          v24 = "";
-          v15->uControlParam = 0;
-        }
-        goto LABEL_79;
-      }
-      v17 = v16 - 9;
-      if ( !v17 )
-      {
-        v24 = (const char *)sub_445308(pNPC->uProfession);
-        goto LABEL_79;
-      }
-      v18 = v17 - 4;
-      if ( v18 )
-      {
-        v19 = v18 - 6;
-        if ( !v19 )
-        {
-          v23 = pNPC->bDrawSomeAnim;
-          goto LABEL_63;
-        }
-        v20 = v19 - 1;
-        if ( !v20 )
-        {
-          v23 = pNPC->_anim_current_time;
-          goto LABEL_63;
-        }
-        v21 = v20 - 1;
-        if ( !v21 )
-        {
-          v23 = pNPC->_anim_end_time;
-          goto LABEL_63;
-        }
-        v22 = v21 - 1;
-        if ( !v22 )
-        {
-          v23 = pNPC->evtd;
-          goto LABEL_63;
-        }
-        if ( v22 == 1 )
-        {
-          v23 = pNPC->evte;
-          goto LABEL_63;
-        }
+
+    if ( v16 > 88 )
+    {
         v24 = "";
-        goto LABEL_79;
-      }
-      if ( pNPC->uFlags & 0x80 )
-      {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName);
-        v24 = pTmpBuf;
-        goto LABEL_79;
-      }
-      v24 = pGlobalTXT_LocalizationStrings[122];
-    }
-LABEL_79:
+    }
+	else if ( v16 == 88 )
+		v24 = pGlobalTXT_LocalizationStrings[581];
+    else if ( v16 == 87 )
+	    v24 = pGlobalTXT_LocalizationStrings[580];
+    else if ( v16 == 86 )
+	    v24 = pGlobalTXT_LocalizationStrings[579];
+    else if ( v16 == 85 )
+		v24 = pGlobalTXT_LocalizationStrings[578];
+    else if ( v16 == 77 )
+        v24 = pGlobalTXT_LocalizationStrings[407];
+    else if ( v16 == 76 )
+    {
+		if ( pNPC->uFlags & 0x80 )
+		{
+			sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName);
+			v24 = pTmpBuf;
+		}
+		else
+			v24 = pGlobalTXT_LocalizationStrings[406];
+    }
+	else if ( v16 == 24 )
+    {
+		v23 = pNPC->evtf;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+    }
+	else if ( v16 == 9 )
+		v24 = (const char *)sub_445308(pNPC->uProfession);
+	else if ( v16 == 19 )
+	{
+		v23 = pNPC->bDrawSomeAnim;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+	}
+	else if ( v16 == 20 )
+	{
+		v23 = pNPC->_anim_current_time;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+	}
+	else if ( v16 == 21 )
+	{
+		v23 = pNPC->_anim_end_time;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+	}
+	else if ( v16 == 22 )
+	{
+		v23 = pNPC->evtd;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+	}
+	else if ( v16 == 23 )
+	{
+		v23 = pNPC->evte;
+		v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
+		if ( !v24 )
+		{
+			v24 = "";
+			v15->uControlParam = 0;
+		}
+	}
+	else if ( v16 == 13 )
+	{
+		if ( pNPC->uFlags & 0x80 )
+		{
+			sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName);
+			v24 = pTmpBuf;
+		}
+		else
+			v24 = pGlobalTXT_LocalizationStrings[122];
+	}
+	else
+		v24 = "";
+	
+
     if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
     {
       pInString = 0;
--- a/mm7_4.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_4.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -2889,11 +2889,11 @@
   pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE);
   pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
   
-  if (byte_4ED498)
+  if (SoundSetAction[24][0])
     for (uint i = 0; i < 4; ++i)
     {
-      pSoundList->LoadSound(2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
-      pSoundList->LoadSound(2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
+      pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
+      pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
     }
 }
 
@@ -2941,7 +2941,7 @@
   v0 = pParty->pPlayers;
   do
   {
-    if ( byte_4ED498 )
+    if (SoundSetAction[24][0])
     {
       v1 = 0;
       if ( (signed int)pSoundList->uNumSounds <= 0 )
@@ -2952,7 +2952,7 @@
       else
       {
         v2 = (char *)&pSoundList->pSounds->uSoundID;
-        while ( *(int *)v2 != 2 * ((unsigned __int8)byte_4ED498 + 50 * v0->uVoiceID) + 4998 )
+        while ( *(int *)v2 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4998 )
         {
           ++v1;
           v2 += 120;
@@ -2971,7 +2971,7 @@
       else
       {
         v5 = (char *)&pSoundList->pSounds->uSoundID;
-        while ( *(int *)v5 != 2 * ((unsigned __int8)byte_4ED498 + 50 * v0->uVoiceID) + 4999 )
+        while ( *(int *)v5 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4999 )
         {
           ++v4;
           v5 += 120;
--- a/mm7_5.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_5.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -342,7 +342,7 @@
             if ( pMessageQueue_50CBD0->uNumMessages )
               pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
             uAction = 0;
-            uNumSeconds = uMessage - 134;
+            int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue;
             v4 = 0;
 
             for (uint i = 0; i < 2; ++i)
@@ -377,11 +377,12 @@
               //}
               //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
             }
-            if ( (signed int)(uNumSeconds + (unsigned __int8)pParty->field_709) < uAction )
+
+            if ( (signed int)(hireling_idx + (unsigned __int8)pParty->field_709) < uAction )
             {
               //Actor::Actor(&actor);
               memset(&actor, 0, 0x344u);
-              actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - uNumSeconds;
+              actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx;
               pActor = &actor;
 //_actor_init_dlg:
               pActor->InitializeDialogue(v0);
@@ -3624,7 +3625,7 @@
 //LABEL_733:
           GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
           continue;
-        case UIMSG_194:
+        case UIMSG_Game_Action:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           OnPressSpace();
@@ -13147,7 +13148,7 @@
   //unsigned __int8 v8; // sf@8
   //unsigned __int8 v9; // of@8
   char pContainer[20]; // [sp+Ch] [bp-1Ch]@7
-  Texture *v11; // [sp+20h] [bp-8h]@5
+  //Texture *v11; // [sp+20h] [bp-8h]@5
   //int v12; // [sp+24h] [bp-4h]@5
 
   byte_506550 = 0;
@@ -13159,11 +13160,11 @@
   else
     dword_50654C = 0;
 
-  v11 = (Texture *)&pPlayer->field_152[11 * school + 63];
+  char *v11 = &pPlayer->field_152[11 * school + 63];
 
   for (uint i = 1; i < 12; ++i)
   {
-    if ( v11->pName[i] )
+    if (v11[i])
     {
       sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]);
       dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
@@ -16172,6 +16173,7 @@
       return;
     }
   }
+
   if ( pParty->pPickedItem.uItemID )//        
   {
     //v1 = 0;
@@ -16188,6 +16190,7 @@
     }
     //while ( v1 < 4 );
   }
+
   pEventTimer->Pause();
   if ( pCurrentScreen <= SCREEN_CHEST )
   {
--- a/mm7_data.cpp	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_data.cpp	Sun Feb 17 08:51:02 2013 +0600
@@ -1097,16 +1097,128 @@
   "pc19lhu", "pc20lhu", "pc21lhu", "pc22lhu", "pc23lhu", "pc24lhu",
   "pc25lhu"
 };
-short SoundSetAction[192]= // 4ED3D8
+
+unsigned char byte_4ECF08[48][25] =      // 4ECF08
+{
+  {2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1},
+  {2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2}, // IMCOMPLETE
+  {2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
+  {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2},
+  {2, 2, 2, 2, 2, 1, 2, 2}
+};
+unsigned char SoundSetAction[110][8] = // 4ED3D8
 {
-	0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 37, 38, 45, 0, 0, 37, 0, 0, 47, 53, 0, 0, 0, 2, 0, 0, 25, 0, 0, 0, 0, 1, 0, 0, 47, 0,
-	0, 0, 0, 3, 0, 0, 41, 42, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 5, 0, 0, 21, 22, 23, 24, 45, 6, 0, 0, 47, 0, 0, 0, 0, 7, 0,
-	0, 43, 48, 0, 0, 0, 8, 0, 0, 38, 0, 0, 0, 0, 9, 0, 0, 39, 0, 0, 0, 0, 13, 0, 0, 37, 38, 0, 0, 0, 23, 0, 0, 25, 0, 0, 0,
-	0, 0, 0, 0, 37, 38, 45, 0, 0, 25, 0, 0, 25, 0, 0, 0, 0, 26, 0, 0, 38, 47, 0, 0, 0, 27, 0, 0, 41, 42, 0, 0, 0, 28, 0, 0,
-	25, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 30, 0, 0, 25, 0, 0, 0, 0, 29, 0, 0, 27, 0, 0, 0, 0, 32, 33, 0, 37, 38, 0, 0, 0,
-	34, 0, 0, 53, 0, 0, 0, 0
-}; // weak
-unsigned char byte_4ED498 = 15; // weak
+  { 0,  0,  0,  0,  0,  0,  0,  0},
+  {38,  0,  0, 37, 38, 45,  0,  0},
+  {37,  0,  0, 47, 53,  0,  0,  0},
+  { 2,  0,  0, 25,  0,  0,  0,  0},
+  { 1,  0,  0, 47,  0,  0,  0,  0},
+  { 3,  0,  0, 41, 42,  0,  0,  0},
+  { 0,  0,  0, 33,  0,  0,  0,  0},
+  { 5,  0,  0, 21, 22, 23, 24, 45},
+  { 6,  0,  0, 47,  0,  0,  0,  0},
+  { 7,  0,  0, 43, 48,  0,  0,  0},
+  { 8,  0,  0, 38,  0,  0,  0,  0},
+  { 9,  0,  0, 39,  0,  0,  0,  0},
+  {13,  0,  0, 37, 38,  0,  0,  0},
+  {23,  0,  0, 25,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38, 45,  0,  0},
+  {25,  0,  0, 25,  0,  0,  0,  0},
+  {26,  0,  0, 38, 47,  0,  0,  0},
+  {27,  0,  0, 41, 42,  0,  0,  0},
+  {28,  0,  0, 25,  0,  0,  0,  0},
+  { 0,  0,  0, 51,  0,  0,  0,  0},
+  {30,  0,  0, 25,  0,  0,  0,  0},
+  {29,  0,  0, 27,  0,  0,  0,  0},
+  {32, 33,  0, 37, 38,  0,  0,  0},
+  {34,  0,  0, 53,  0,  0,  0,  0},
+  {15,  0,  0, 34, 35, 36,  0,  0},
+  { 0,  0,  0,  3,  0,  0,  0,  0},
+  {22,  0,  0,  5,  0,  0,  0,  0},
+  {20,  0,  0,  8,  0,  0,  0,  0},
+  {20,  0,  0,  9,  0,  0,  0,  0},
+  {19,  0,  0,  7,  0,  0,  0,  0},
+  {21,  0,  0,  2,  0,  0,  0,  0},
+  {18,  0,  0,  6,  0,  0,  0,  0},
+  { 0,  0,  0, 11,  0,  0,  0,  0},
+  {17,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0, 12,  0,  0,  0,  0},
+  {17,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0, 37,  0,  0,  0,  0},
+  { 0,  0,  0, 49,  0,  0,  0,  0},
+  {24,  0,  0, 25,  0,  0,  0,  0},
+  {31,  0,  0, 25,  0,  0,  0,  0},
+  { 0,  0,  0, 41, 42,  0,  0,  0},
+  { 0,  0,  0, 39, 48,  0,  0,  0},
+  { 0,  0,  0, 46,  0,  0,  0,  0}, 
+  { 0,  0,  0, 39, 48,  0,  0,  0},
+  { 0,  0,  0, 41, 42,  0,  0,  0},
+  { 0,  0,  0, 39, 48,  0,  0,  0},
+  {41,  0,  0, 21,  0,  0,  0,  0},
+  {40,  0,  0, 21,  0,  0,  0,  0},
+  {16,  0,  0, 46,  0,  0,  0,  0},
+  { 0,  0,  0, 40,  0,  0,  0,  0},
+  { 0,  0,  0, 39,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 48, 49, 50,  0,  0},
+  { 0,  0,  0, 44,  0,  0,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38, 45,  0,  0},
+  { 0,  0,  0, 41, 42,  0,  0,  0},
+  { 0,  0,  0, 47,  0,  0,  0,  0},
+  { 0,  0,  0, 39, 48,  0,  0,  0},
+  { 0,  0,  0, 39, 48,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 31,  0,  0,  0,  0},
+  { 0,  0,  0, 32,  0,  0,  0,  0},
+  {47,  0,  0, 46,  0,  0,  0,  0},
+  {22,  0,  0,  5,  0,  0,  0,  0},
+  { 0,  0,  0, 25,  0,  0,  0,  0},
+  { 0,  0,  0, 37,  0,  0,  0,  0},
+  { 0,  0,  0, 52,  0,  0,  0,  0},
+  { 0,  0,  0, 45,  0,  0,  0,  0},
+  { 0,  0,  0, 27,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 49,  0,  0,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38, 45,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38, 45,  0,  0},
+  { 0,  0,  0, 47,  0,  0,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  {44,  0,  0, 39, 48,  0,  0,  0},
+  { 0,  0,  0, 48, 49,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0, 31,  0,  0,  0,  0},
+  {32, 33,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 47,  0,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  { 0,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0, 47,  0,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0, 38,  0,  0,  0,  0},
+  { 0,  0,  0,  5,  0,  0,  0,  0},
+  { 0,  0,  0, 37, 38,  0,  0,  0},
+  { 0,  0,  0, 44,  0,  0,  0,  0},
+  { 0,  0,  0, 48,  0,  0,  0,  0},
+  { 4,  0,  0,  0,  0,  0,  0,  0},
+  { 0,  0,  0, 58,  0,  0,  0,  0},
+  {10,  0,  0, 45,  0,  0,  0,  0},
+  {11,  0,  0, 47,  0,  0,  0,  0},
+  {12,  0,  0, 43, 48,  0,  0,  0},
+  {39,  0,  0, 48,  0,  0,  0,  0},
+  {14,  0,  0, 48,  0,  0,  0,  0},
+  {17,  0,  0,  0,  0,  0,  0,  0}
+};
 __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4] = {34, 149, 264, 379};
 char byte_4ED970_skill_learn_ability_by_class_table[32][37];
 int dword_4EDEA0[777]; // weak
--- a/mm7_data.h	Sun Feb 17 08:50:45 2013 +0600
+++ b/mm7_data.h	Sun Feb 17 08:51:02 2013 +0600
@@ -978,8 +978,9 @@
 extern const char *drh_texnames_by_face[25];
 extern const char *dlh_texnames_by_face[25];
 extern const char *dlhu_texnames_by_face[25];
-extern short SoundSetAction[192]; // weak
-extern unsigned char byte_4ED498; // weak
+extern unsigned char byte_4ECF08[48][25];
+extern unsigned char SoundSetAction[110][8]; // weak
+//extern unsigned char byte_4ED498; // weak
 extern __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4];
 extern char byte_4ED970_skill_learn_ability_by_class_table[32][37];
 extern int dword_4EDEA0[]; // weak