changeset 495:90fdb47bfcba

guilds ...
author Gloval
date Thu, 28 Feb 2013 21:45:39 +0400
parents af286cec8967
children 0e20e886365d
files Events2D.h GUIWindow.cpp GUIWindow.h Spells.h mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_data.cpp mm7_data.h stru159.h stru6.cpp
diffstat 11 files changed, 110 insertions(+), 135 deletions(-) [+]
line wrap: on
line diff
--- a/Events2D.h	Thu Feb 28 18:18:52 2013 +0400
+++ b/Events2D.h	Thu Feb 28 21:45:39 2013 +0400
@@ -1,12 +1,45 @@
 #pragma once
 
-
+/*  296 */
+enum BildingType : unsigned short
+	{
+	BildingType_WeaponShop = 0x1,
+	BildingType_ArmorShop = 0x2,
+	BildingType_MagicShop = 0x3,
+	BildingType_AlchemistShop = 0x4,
+	BildingType_FireGuild = 0x5,
+	BildingType_AirGuild = 0x6,
+	BildingType_WaterGuild = 0x7,
+	BildingType_EarthGuild = 0x8,
+	BildingType_SpiritGuild = 0x9,
+	BildingType_MindGuild = 0xA,
+	BildingType_BodyGuild = 0xB,
+	BildingType_LightGuild = 0xC,
+	BildingType_DarkGuild = 0xD,
+	BildingType_14 = 0xE,
+	BildingType_15 = 0xF,
+	BildingType_16 = 0x10,
+	BildingType_TownHall = 0x11,
+	BildingType_18 = 0x12,
+	BildingType_19 = 0x13,
+	BildingType_Throne_Room = 0x14,
+	BildingType_Tavern = 0x15,
+	BildingType_Bank = 0x16,
+	BildingType_Temple = 0x17,
+	BildingType_Unic = 0x19,
+	BildingType_1A = 0x1A,
+	BildingType_Stables = 0x1B,
+	BildingType_Boats = 0x1C,
+	BildingType_House = 0x1D,
+	BildingType_Training = 0x1E,
+	BildingType_Jail = 0x1F,
+	};
 
 /*  168 */
 #pragma pack(push, 1)
 struct _2devent
 {
-  unsigned __int16 uType;
+  BildingType uType;
   unsigned __int16 uAnimationID;
   char *pName;
   const char *pProprieterName;
--- a/GUIWindow.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/GUIWindow.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -1146,9 +1146,7 @@
   else
   {
     sprintfex( pTmpBuf, pGlobalTXT_LocalizationStrings[429],
-      //p2DEvents_minus1_::08[13 * (unsigned int)ptr_507BC0->ptr_1C],
       p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName,
-      //p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]);
       p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle);
     v18.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v19, pTmpBuf, 3u);
       switch ( in_current_building_type )
@@ -1173,10 +1171,7 @@
         case BildingType_MindGuild:
         case BildingType_BodyGuild:
         case BildingType_LightGuild:
-        case BildingType_Dark:
-        //case BildingType_14:
-        //case BildingType_15:
-        //case BildingType_16:
+        case BildingType_DarkGuild:
           GuildDialog();
           break;
         case BildingType_18:
@@ -1193,7 +1188,7 @@
           BankDialog();
           break;
         case BildingType_Temple:
-          TampleDialog();
+          TempleDialog();
           break;
         case BildingType_Stables:
           TravelByTransport();
--- a/GUIWindow.h	Thu Feb 28 18:18:52 2013 +0400
+++ b/GUIWindow.h	Thu Feb 28 21:45:39 2013 +0400
@@ -156,39 +156,7 @@
 
 
 
-/*  296 */
-enum BildingType
-{
-  BildingType_WeaponShop = 0x1,
-  BildingType_ArmorShop = 0x2,
-  BildingType_MagicShop = 0x3,
-  BildingType_AlchemistShop = 0x4,
-  BildingType_FireGuild = 0x5,
-  BildingType_AirGuild = 0x6,
-  BildingType_WaterGuild = 0x7,
-  BildingType_EarthGuild = 0x8,
-  BildingType_SpiritGuild = 0x9,
-  BildingType_MindGuild = 0xA,
-  BildingType_BodyGuild = 0xB,
-  BildingType_LightGuild = 0xC,
-  BildingType_Dark = 0xD,
-  BildingType_14 = 0xE,
-  BildingType_15 = 0xF,
-  BildingType_16 = 0x10,
-  BildingType_TownHall = 0x11,
-  BildingType_18 = 0x12,
-  BildingType_19 = 0x13,
-  BildingType_20 = 0x14,
-  BildingType_Tavern = 0x15,
-  BildingType_Bank = 0x16,
-  BildingType_Temple = 0x17,
-  BildingType_1A = 0x1A,
-  BildingType_Stables = 0x1B,
-  BildingType_Boats = 0x1C,
-  BildingType_House = 0x1D,
-  BildingType_Training = 0x1E,
-  BildingType_Jail = 0x1F,
-};
+
 enum UIMessageType
 {
   UIMSG_00 = 0x0,
--- a/Spells.h	Thu Feb 28 18:18:52 2013 +0400
+++ b/Spells.h	Thu Feb 28 21:45:39 2013 +0400
@@ -117,7 +117,7 @@
   SPELL_101 = 101,
   SPELL_LASER_PROJECTILE = 102,
 
-  SPELL_150 = 150,
+  BECOME_MAGIC_GUILD_MEMBER = 150,
   SPELL_151 = 151,
   SPELL_152 = 152,
   SPELL_153 = 153
--- a/mm7_2.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/mm7_2.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -3608,8 +3608,8 @@
 
 
 //----- (004BC8D5) --------------------------------------------------------
-Texture *__cdecl sub_4BC8D5()
-{
+void sub_4BC8D5()
+	{
   int v0; // esi@1
   char *v1; // ebx@1
   signed int v2; // edi@1
@@ -3619,7 +3619,7 @@
   Texture *result; // eax@15
   int v7; // [sp+10h] [bp-4h]@0
 
-  v0 = v7;
+ // v0 = v7;
   v1 = (char *)window_SpeakInHouse->ptr_1C - 139;
   v2 = 0;
   do
@@ -3668,11 +3668,10 @@
     _u->Reset();
     *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0;
     *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1;
-    result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
-    *(&dword_F8B164 + v2) = result;
+    *(&dword_F8B164 + v2) = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
   }
   while ( v2 < 12 );
-  return result;
+  return;
 }
 
 
--- a/mm7_3.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/mm7_3.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -13957,126 +13957,126 @@
 					{
 					if ( !_strnicmp(test_string, "wea", 3) )
 						{
-						p2DEvents[i].uType = 1;
+						p2DEvents[i].uType = BildingType_WeaponShop;
 						break;
 						}
 					if ( !_strnicmp(test_string, "arm", 3) )
 						{
-						p2DEvents[i].uType = 2;
+						p2DEvents[i].uType = BildingType_ArmorShop;
 						break;
 						}
 					if ( !_strnicmp(test_string, "mag", 3) )
 						{
-						p2DEvents[i].uType = 3;
+						p2DEvents[i].uType = BildingType_MagicShop;
 						break;
 						}
 					if ( !_strnicmp(test_string, "alc", 3) )
 						{
-						p2DEvents[i].uType = 4;
+						p2DEvents[i].uType = BildingType_AlchemistShop;
 						break;
 						}
 					if ( !_strnicmp(test_string, "sta", 3) )
 						{
-						p2DEvents[i].uType = 27;
+						p2DEvents[i].uType = BildingType_Stables;
 						break;
 						}
 					if ( !_strnicmp(test_string, "boa", 3) )
 						{
-						p2DEvents[i].uType = 28;
+						p2DEvents[i].uType = BildingType_Boats;
 						break;
 						}
 					if ( !_strnicmp(test_string, "tem", 3) )
 						{
-						p2DEvents[i].uType = 23;
+						p2DEvents[i].uType = BildingType_Temple;
 						break;
 						}
 					if ( !_strnicmp(test_string, "tra", 3) )
 						{
-						p2DEvents[i].uType = 30;
+						p2DEvents[i].uType = BildingType_Training;
 						break;
 						}
 					if ( !_strnicmp(test_string, "tow", 3) )
 						{
-						p2DEvents[i].uType = 17;
+						p2DEvents[i].uType = BildingType_TownHall;
 						break;
 						}
 
 					if ( !_strnicmp(test_string, "tav", 3) )
 						{
-						p2DEvents[i].uType = 21;
+						p2DEvents[i].uType = BildingType_Tavern;
 						break;
 						}
 					if ( !_strnicmp(test_string, "ban", 3) )
 						{
-						p2DEvents[i].uType = 22;
+						p2DEvents[i].uType = BildingType_Bank;
 						break;
 						}
 					if ( !_strnicmp(test_string, "fir", 3) )
 						{
-						p2DEvents[i].uType = 5;
+						p2DEvents[i].uType = BildingType_FireGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "air", 3) )
 						{
-						p2DEvents[i].uType = 6;
+						p2DEvents[i].uType = BildingType_AirGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "wat", 3) )
 						{
-						p2DEvents[i].uType = 7;
+						p2DEvents[i].uType = BildingType_WaterGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "ear", 3) )
 						{
-						p2DEvents[i].uType = 8;
+						p2DEvents[i].uType = BildingType_EarthGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "spi", 3) )
 						{
-						p2DEvents[i].uType = 9;
+						p2DEvents[i].uType = BildingType_SpiritGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "min", 3) )
 						{
-						p2DEvents[i].uType = 10;
+						p2DEvents[i].uType = BildingType_MindGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "bod", 3) )
 						{
-						p2DEvents[i].uType = 11;
+						p2DEvents[i].uType = BildingType_BodyGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "lig", 3) )
 						{
-						p2DEvents[i].uType = 12;
+						p2DEvents[i].uType = BildingType_LightGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "dar", 3) )
 						{
-						p2DEvents[i].uType = 13;
+						p2DEvents[i].uType = BildingType_DarkGuild;
 						break;
 						}
 					if ( !_strnicmp(test_string, "ele", 3) )
 						{
-						p2DEvents[i].uType = 14;
+						p2DEvents[i].uType = BildingType_14;
 						break;
 						}
 					if ( !_strnicmp(test_string, "sel", 3) )
 						{
-						p2DEvents[i].uType = 15;
+						p2DEvents[i].uType = BildingType_15;
 						break;
 						}
 					if ( !_strnicmp(test_string, "mir", 3) )
 						{
-						p2DEvents[i].uType = 16;
+						p2DEvents[i].uType = BildingType_16;
 						break;
 						}
 					if ( !_strnicmp(test_string, "mer", 3) )
 						{
-						p2DEvents[i].uType = 17;
+						p2DEvents[i].uType = BildingType_TownHall;
 						break;
 						}
-					p2DEvents[i].uType = 18;
+					p2DEvents[i].uType = BildingType_18;
 					}
 					break;
 
--- a/mm7_4.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/mm7_4.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -9262,17 +9262,11 @@
 void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2)
 {
   //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
-  if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_d )
+  if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId )
     pAudioPlayer->PlaySound(
       //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
-      (SoundID)(a2 + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_d) + 300),
-      806,
-      0,
-      -1,
-      0,
-      0,
-      0,
-      0);
+      (SoundID)(a2 + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId) + 300),
+      806, 0, -1, 0, 0, 0, 0);
 }
 
 //----- (004B1ECE) --------------------------------------------------------
@@ -12276,7 +12270,7 @@
 void GuildDialog()
 {
   GUIWindow *v0; // ebx@1
-  Player *v1; // edi@1
+  Player *currPlayer; // edi@1
   signed int base_teach_price; // ebx@1
   int v3; // edi@6
   int result; // eax@11
@@ -12343,7 +12337,7 @@
   v0 = window_SpeakInHouse;
   memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
   v58 = pPlayers[uActiveCharacter];
-  v1 = v58;
+  currPlayer = v58;
   working_window.uFrameX = 483;
   v53 = 148;
   v54 = 334;
@@ -12351,7 +12345,7 @@
   hi_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
   //v2 = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C] * 500.0);
   base_teach_price = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0);
-  v63 = base_teach_price * (100 - v1->GetMerchant()) / 100;
+  v63 = base_teach_price * (100 - currPlayer->GetMerchant()) / 100;
   if ( v63 < base_teach_price / 3 )
     v63 = base_teach_price / 3;
   strcpy(Dest, "");
@@ -12365,7 +12359,7 @@
     {
       if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
       {
-        v3 = (int)(&v1->uIntelligence + dword_F8B19C); //test skill
+        v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill
         if ( *(short *)v3 )
         {
           sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dword_F8B19C + 20]); //"You already know the %s skill"
@@ -12400,7 +12394,7 @@
       {
         pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
-        v1 = v58;
+        currPlayer = v58;
       }
       v63 += 70;
       v62 += 280;
@@ -12417,7 +12411,7 @@
       {
         pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
         ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
-        v1 = v58;
+        currPlayer = v58;
       }
       v63 += 70;
       v62 += 280;
@@ -12462,23 +12456,21 @@
         v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
         v16 = (int)window_SpeakInHouse->ptr_1C;
         uPlayerID = uActiveCharacter - 1;
-        v17 = v1->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16,  2);
+        v17 = currPlayer->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16,  2);
         v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);     
         v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
-        working_window.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138,  main_text_color, v18, 3);
+        working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138,  main_text_color, v18, 3);
         return;
       }
     }
     return;
   }
   if ( !(unsigned __int16)_449B57_test_bit(
-                            (unsigned __int8 *)v1->_guilds_member_bits,
-                            word_4F0704[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
+                            (unsigned __int8 *)currPlayer->_guilds_member_bits,
+                            guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
   { //you must me member
-    v36 = pNPCTopics[121].pText;
-    v37 = hi_text_color;
     v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
-    working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u);
+    working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, hi_text_color, pNPCTopics[121].pText, 3u);
     pDialogueWindow->pNumPresenceButton = 0;
     return;
   }
@@ -12608,8 +12600,8 @@
 
 
 //----- (004B705E) --------------------------------------------------------
-int __cdecl TampleDialog()
-{
+void TempleDialog()
+	{
   GUIWindow *v0; // ebx@1
   Player *v1; // esi@1
   int v2; // edi@1
@@ -12693,11 +12685,10 @@
     {
       if ( dword_F8B19C != 11 )
       {
-        result = dword_F8B19C - 96;
+
         if ( dword_F8B19C == 96 )
         {
-          result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
-          if ( result )
+          if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
           {
             v4 = pDialogueWindow;
             v61 = pDialogueWindow;
@@ -12791,7 +12782,7 @@
             }
           }
         }
-        return result;
+        return;
       }
 
       // DONATION
@@ -12856,9 +12847,8 @@
       }
       goto LABEL_55;
     }
-    result = v1->_4B6FF9();
-    if ( !result )
-      return result;
+    if ( !v1->_4B6FF9() )
+      return;
     v25 = 0;
     if ( pParty->uNumGold < v2 )
     {
@@ -12914,17 +12904,8 @@
     v1->PlaySound(SPEECH_82, 0);
     pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
 LABEL_46:
-    /*result = pMessageQueue_50CBD0->uNumMessages;
-    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-    {
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
-      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
-      result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
-      *(&pMessageQueue_50CBD0->uNumMessages + result) = v25;
-      ++pMessageQueue_50CBD0->uNumMessages;
-    }*/
     pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
-    return result; // void func
+    return ; // void func
   }
   v63 = 1;
   v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
@@ -12959,10 +12940,9 @@
   v64 = (174 - (signed int)v66) / v46;
   if ( v64 > 32 )
     v64 = 32;
-  result = v43->pStartingPosActiveItem;
   v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
-  v65 = v42 + result;
-  if ( v42 + result < result + v43->pNumPresenceButton )
+  v65 = v42 + v43->pStartingPosActiveItem;
+  if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
   {
     v61 = (GUIWindow *)(v42 + 2);
     v66 = (DDM_DLV_Header *)&a1[100 * v42];
@@ -12985,11 +12965,10 @@
       v66 = (DDM_DLV_Header *)((char *)v66 + 100);
       v61 = (GUIWindow *)((char *)v61 + 1);
       ++v65;
-      result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
-    }
-    while ( (signed int)v65 < result );
-  }
-  return result;
+    }
+    while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
+  }
+  return;
 }
 
 
@@ -14169,7 +14148,7 @@
 LABEL_20:
   pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)sHouseName);
   //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
-  if ( pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_d )
+  if ( pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].uRoomSoundId )
     HousePlaySomeSound(v9, 1);
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
     pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
@@ -14219,7 +14198,8 @@
     if ( uExitMapID > 0 )
     {
       //v17 = (unsigned int *)(uExitMapID - 1);
-      if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) )
+	  if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
+     // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) )
       {
         //uExitPic = 0;
         uHouse_ExitPic = 0;
@@ -14399,7 +14379,7 @@
 
 		uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
 		in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
-		if ( in_current_building_type == BildingType_20 && pParty->uFine )   // going 2 jail
+		if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine )   // going 2 jail
 			{
 			uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
 			uHouseID = HOUSE_JAIL;
@@ -14445,9 +14425,10 @@
 			}
 		else
 			{ //guilds
-			v19 = word_4F0704[uHouseID-139] - 1; //some gild flag check
+			v19 = guild_mambership_flags[uHouseID-139]; //guilds flags 
 			//v20 = uHouseID;
-			if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
+			//if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
+			if(_449B57_test_bit((unsigned char*)pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
 				{
 				HousePlaySomeSound(uHouseID, 3);
 				return 1;
--- a/mm7_data.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/mm7_data.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -1664,7 +1664,7 @@
 
 //__int16 word_4F063E[290];
 //__int16 word_4F06D8[22];
-int word_4F0704[32]={
+int guild_mambership_flags[32]={
    54, 54, 54, 54, 52, 52, 52, 52, 55, 55, 55, 55, 53, 53,
 	   53, 53, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56,
 	   56, 56, 59, 59, 60, 60};
--- a/mm7_data.h	Thu Feb 28 18:18:52 2013 +0400
+++ b/mm7_data.h	Thu Feb 28 21:45:39 2013 +0400
@@ -1008,7 +1008,7 @@
 extern char uItemsAmountPerShopType[]; // weak
 //extern __int16 word_4F063E[290];
 //extern __int16 word_4F06D8[22];
-extern int word_4F0704[32];
+extern int guild_mambership_flags[32];
 extern __int16 word_4F0754[49];
 //extern __int16 word_4F07B6[88];
 extern __int16 word_4F0866[14];
@@ -2326,7 +2326,7 @@
 int __cdecl sub_4B6478();
 bool __fastcall sub_4B68EA(int a1);
 void __cdecl TravelByTransport();
-int __cdecl TampleDialog();
+void TempleDialog();
 void __cdecl TownHallDialog();
 void __cdecl BankDialog();
 void __cdecl TavernDialog();
@@ -2339,7 +2339,7 @@
 void __cdecl sub_4BBCDD();
 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb
 void __cdecl ArenaFight();
-struct Texture *__cdecl sub_4BC8D5();
+void  sub_4BC8D5();
 struct GUIButton *__cdecl UI_CreateEndConversationButton();
 void __fastcall DrawLearnSkillDialog(signed int uMessageParam);
 signed int __cdecl sub_4BD8B5();
--- a/stru159.h	Thu Feb 28 18:18:52 2013 +0400
+++ b/stru159.h	Thu Feb 28 21:45:39 2013 +0400
@@ -10,7 +10,7 @@
   int field_4;
   int field_8;
   unsigned __int8 uBuildingType;
-  unsigned __int8 field_d;
+  unsigned __int8 uRoomSoundId;
   unsigned __int16 padding_e;
 };
 #pragma pack(pop)
--- a/stru6.cpp	Thu Feb 28 18:18:52 2013 +0400
+++ b/stru6.cpp	Thu Feb 28 21:45:39 2013 +0400
@@ -1341,8 +1341,7 @@
       v6 = "zapp";
     break;
       
-    case SPELL_150:
-      __debugbreak(); // spell id == 150 wtf
+    case BECOME_MAGIC_GUILD_MEMBER:
     case SPELL_AIR_FEATHER_FALL:
     case SPELL_SPIRIT_DETECT_LIFE:
     case SPELL_SPIRIT_FATE: