changeset 786:da80bd2922df

Слияние
author Ritor1
date Sun, 24 Mar 2013 09:19:36 +0600
parents a821bbace194 (current diff) c47efaf23642 (diff)
children 3a77fbf7d0b8
files MM7.h UIHouses.cpp mm7_2.cpp mm7_4.cpp mm7_data.cpp
diffstat 20 files changed, 1933 insertions(+), 2708 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/Actor.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -21,17 +21,31 @@
 #include "GUIWindow.h"
 #include "GUIFont.h"
 
-
-
-
 Actor pActors[500];
 int uNumActors;
 
 stru319 stru_50C198; // idb
 
-
-
-
+//----- (00448A40) --------------------------------------------------------
+void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
+{
+  if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
+  {
+    if ( bToggle )
+    {
+      pActors[uActorID].uAttributes |= uFlag;
+    }
+    else
+    {
+      if ( uFlag == 0x10000 )
+      {
+        if (pActors[uActorID].uAIState == Disabled )
+          pActors[uActorID].uAIState = Standing;
+      }
+      pActors[uActorID].uAttributes &= ~uFlag;
+    }
+  }
+}
 
 //----- (00448518) --------------------------------------------------------
 void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3)
@@ -142,7 +156,6 @@
   }
 }
 
-
 //----- (00445D4A) --------------------------------------------------------
 void Actor::InitializeDialogue(int bPlayerSaysHello)
 {
@@ -289,7 +302,6 @@
       pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0);
   }
 }
-
   
 //----- (0040894B) --------------------------------------------------------
 bool Actor::CanAct()
@@ -1412,7 +1424,6 @@
   }
 }
 
-
 //----- (0043ABB0) --------------------------------------------------------
 bool Actor::ArePeasantsOfSameFaction(Actor *a1, Actor *a2)
 {
@@ -1468,7 +1479,6 @@
   }
 }
 
-
 //----- (00404874) --------------------------------------------------------
 char __fastcall Actor::_404874(unsigned int uActorID, AIDirection *a2, int a3, char a4)
 {
@@ -1950,7 +1960,6 @@
   return result;
 }
 
-
 //----- (00404030) --------------------------------------------------------
 void Actor::FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, AIDirection *a4)
 {
@@ -2003,8 +2012,6 @@
     AI_Stand(uActorID, uObjID, uActionLength, a4);
 }
 
-
-
 //----- (00403EB6) --------------------------------------------------------
 void Actor::AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, AIDirection *a4)
 {
@@ -2029,7 +2036,6 @@
   actor->UpdateAnimation();
 }
 
-
 //----- (00403E61) --------------------------------------------------------
 void __fastcall Actor::StandAwhile(unsigned int uActorID)
 {
@@ -2148,7 +2154,6 @@
       Actor::_402AD7(v24, a2, rand() % 2, 64, arg0);
 }
 
-
 //----- (00438CF3) --------------------------------------------------------
 void Actor::ApplyFineForKillingPeasant(unsigned int uActorID)
 {
@@ -2216,7 +2221,6 @@
   }
 }
 
-
 //----- (0043AE80) --------------------------------------------------------
 void Actor::AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3)
 {
@@ -2326,7 +2330,6 @@
   return;
 }
 
-
 //----- (0043B3E0) --------------------------------------------------------
 int Actor::_43B3E0_CalcDamage(Actor *a1, signed int a2)
 {
@@ -2453,7 +2456,6 @@
   return result;
 }
 
-
 //----- (00403A60) --------------------------------------------------------
 void Actor::_403A60(unsigned int uActorID, signed int edx0, AIDirection *pDir)
 {
@@ -2560,7 +2562,6 @@
     Actor::_402AD7(v22, a2, v22, 64, pDir);
 }
 
-
 //----- (00403854) --------------------------------------------------------
 void Actor::_403854(unsigned int uActorID, signed int edx0, AIDirection *pDir)
 {
@@ -2667,7 +2668,6 @@
     Actor::_402AD7(v22, a2, v22, 64, pDir);
 }
 
-
 //----- (0040368B) --------------------------------------------------------
 void Actor::_40368B(unsigned int uActorID, signed int edx0, AIDirection *pDir)
 {
@@ -2759,7 +2759,6 @@
     Actor::_402AD7(v21, a2, v21, 64, pDir);
 }
 
-
 //----- (00403476) --------------------------------------------------------
 void Actor::_403476(unsigned int uActorID, signed int edx0, AIDirection *pDir)
 {
@@ -2942,7 +2941,6 @@
   v5->UpdateAnimation();
 }
 
-
 //----- (004031C1) --------------------------------------------------------
 char __fastcall Actor::_4031C1_update_job(unsigned int uActorID, signed int a2, int a3)
 {
@@ -3001,7 +2999,6 @@
   return (char)v5;
 }
 
-
 //----- (004030AD) --------------------------------------------------------
 void Actor::_4030AD(unsigned int uActorID, signed int edx0, int arg0)
 {
@@ -3105,7 +3102,6 @@
   pActor->UpdateAnimation();
 }
 
-
 //----- (00402D6E) --------------------------------------------------------
 void Actor::Die(unsigned int uActorID)
 {
@@ -3372,7 +3368,6 @@
   }
 }
 
-
 //----- (0040281C) --------------------------------------------------------
 void Actor::_40281C(unsigned int uActorID, unsigned int a2, signed int uActionLength, AIDirection *pDir, int a5)
 {
@@ -3456,7 +3451,6 @@
   v7->UpdateAnimation();
 }
 
-
 //----- (00402686) --------------------------------------------------------
 void Actor::_402686(unsigned int uActorID, unsigned int a2, signed int uActionLength, AIDirection *a4)
 {
@@ -3817,7 +3811,6 @@
   return 0;
 }
 
-
 //----- (0045976D) --------------------------------------------------------
 void Actor::UpdateAnimation()
 {
@@ -3958,14 +3951,12 @@
   }
 }
 
-
 //----- (00459667) --------------------------------------------------------
 void Actor::Remove()
 {
   this->uAIState = Removed;
 }
 
-
 //----- (0044FD29) --------------------------------------------------------
 int Actor::_44FD29(int a2)
 {
@@ -4096,4 +4087,4 @@
     v8->uSummonerID = result;
   }
   return result;
-}
\ No newline at end of file
+}
--- a/IndoorCameraD3D.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/IndoorCameraD3D.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -7,10 +7,92 @@
 #include "OutdoorCamera.h"
 #include "Render.h"
 #include "LOD.h"
-
 #include "mm7_data.h"
 
+//----- (004361EF) --------------------------------------------------------
+IndoorCameraD3D::IndoorCameraD3D()
+{
+  IndoorCameraD3D *v1; // esi@1
+  //double v2; // st7@1
+  //double v3; // st6@1
+  //double v4; // st5@1
+  //double v5; // st7@1
+  //double v6; // st6@1
+  //double v7; // st5@1
 
+  v1 = this;
+  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4);
+  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14);
+  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24);
+  /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum,
+    24,
+    6,
+    (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4,
+    (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/
+  //v2 = 0;//(double)pBLVRenderParams->vPartyPos.z;
+  //v3 = 0;//(double)pBLVRenderParams->vPartyPos.y;
+  //v4 = 0;//(double)pBLVRenderParams->vPartyPos.x;
+  v1->field_108 = 0.0;
+  v1->blv_party_x = 0;
+  v1->blv_party_y = 0;
+  v1->blv_party_z = 0;
+  //v5 = 0;//(double)pBLVRenderParams->vPartyPos.z;
+  //v6 = 0;//(double)pBLVRenderParams->vPartyPos.y;
+  //v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300);
+  v1->field_138 = 0.0;
+  v1->blv_party_x_2 = 300;
+  v1->blv_party_y_2 = 0;
+  v1->blv_party_z_2 = 0;
+  v1->field_168 = 0.0;
+  v1->field_198 = 0.0;
+  v1->field_1C8 = 0.0;
+  v1->field_1F8 = 0.0;
+  v1->field_228 = 0.0;
+  v1->field_258 = 0.0;
+  v1->field_288 = 0.0;
+  v1->field_2B8 = 0.0;
+  v1->field_2E8 = 0.0;
+  v1->field_2BC = 0.0;
+  v1->field_2C0 = 0.0;
+  v1->field_2C4 = 0.0;
+  v1->field_318 = 0.0;
+  v1->field_2EC = 0.0;
+  v1->field_2F0 = 0.0;
+  v1->field_2F4 = 0.0;
+  v1->field_348 = 0.0;
+  v1->field_31C = 0.0;
+  v1->field_320 = 0.0;
+  v1->field_324 = 0.0;
+  v1->field_378 = 0.0;
+  v1->field_34C = 0.0;
+  v1->field_350 = 0.0;
+  v1->field_354 = 0.0;
+  for (uint i = 0; i < 16384; ++i)
+  {
+    list_0037C[i].field_0 = 0;
+    list_0037C[i].flt_30 = 0.0f;
+  }
+
+  list_0037C_size = 0;
+  for (uint i = 0; i < 256; ++i)
+    list_E0380[i].mm7__vector_000004_size = 0;
+  /*v10 = v1->list_E0380;
+  v12 = 256;
+  do
+  {
+    v10->mm7__vector_000004_size = 0;
+    //mm7__vector_constructor(
+    //  v10->mm7__vector_000004,
+    //  48,
+    //  64,
+    //  (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1);
+    //++v10;
+    --v12;
+  }
+  while ( v12 );*/
+  list_E0380_size = 0;
+  //v1->vdestructor_ptr = &stru8_pvdtor;
+}
 
 //----- (004364C5) --------------------------------------------------------
 void IndoorCameraD3D::ViewTransfrom_OffsetUV(RenderVertexSoft *pVertices, unsigned int uNumVertices, RenderVertexSoft *pOutVertices, stru320 *a5)
@@ -92,8 +174,6 @@
   return !bDoNotShow || (v12 = *v10, v12 >= (signed int)0x40000u) && v12 <= (signed int)0x1F400000u;
 }
 
-
-
 //----- (00436455) --------------------------------------------------------
 bool IndoorCameraD3D::IsCulled(BLVFace *pFace)
 {
@@ -329,7 +409,6 @@
     pIndoorCamera->ViewTransform(a1a + i);
 }
 
-
 //----- (00436932) --------------------------------------------------------
 bool IndoorCameraD3D::GetFacetOrientation(char polyType, Vec3_float_ *a2, Vec3_float_ *a3, Vec3_float_ *a4)
 {
@@ -392,7 +471,6 @@
   }
 }
 
-
 //----- (00438258) --------------------------------------------------------
 bool IndoorCameraD3D::is_face_faced_to_camera(BLVFace *pFace, RenderVertexSoft *a2)
 {
@@ -414,7 +492,6 @@
   this->list_0037C_size = 0;
 }
 
-
 //----- (00438240) --------------------------------------------------------
 void IndoorCameraD3D::_438240_draw_lits()
 {
@@ -479,7 +556,6 @@
   }
 }
 
-
 //----- (00438141) --------------------------------------------------------
 void IndoorCameraD3D::_438141_draw_list_0037C()
 {
@@ -528,7 +604,6 @@
   }
 }
 
-
 //----- (00437D4A) --------------------------------------------------------
 void IndoorCameraD3D::_437D4A_draw_some_vertices(float x, float y, float z, unsigned int a5, char a6, float a7)
 {
@@ -713,7 +788,6 @@
   }
 }
 
-
 //----- (00437C96) --------------------------------------------------------
 void IndoorCameraD3D::do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, unsigned int uDiffuseBegin, const RenderVertexD3D3 *pLineEnd, unsigned int uDiffuseEnd, float z_stuff)
 {
@@ -867,7 +941,6 @@
     MessageBoxW(nullptr, L"draw_debug_line() not implemented for SW rendering", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Core3D.cpp:1383", 0);
 }
 
-
 //----- (00437A55) --------------------------------------------------------
 void IndoorCameraD3D::debug_outline_d3d(const RenderVertexD3D3 *pLineVertices, unsigned int uNumLines, int uDiffuse, float z_stuff)
 {
@@ -896,7 +969,6 @@
   do_draw_debug_line_d3d(&pLineVertices[v5], uDiffuse, pLineVertices, uDiffuse, z_stuff);
 }
 
-
 //----- (004379EE) --------------------------------------------------------
 void IndoorCameraD3D::debug_outline_sw(RenderVertexSoft *a2, unsigned int uNumVertices, unsigned int uDiffuse, float a5)
 {
@@ -926,7 +998,6 @@
   do_draw_debug_line_sw(&a2[v5], uDiffuse, a2, uDiffuse, 0, a5);
 }
 
-
 //----- (00437906) --------------------------------------------------------
 void IndoorCameraD3D::PrepareAndDrawDebugOutline(BLVFace *pFace, unsigned int uDiffuse)
 {
@@ -972,7 +1043,6 @@
 }
 // 50D9D0: using guessed type char static_sub_437906_byte_50D9D0_init_flag;
 
-
 //----- (004378BA) --------------------------------------------------------
 void IndoorCameraD3D::MatrixMultiply(Matrix3x3_float_ *a1, Matrix3x3_float_ *a2, Matrix3x3_float_ *out)
 {
@@ -1010,7 +1080,6 @@
   while ( v6 );
 }
 
-
 //----- (004376E7) --------------------------------------------------------
 void IndoorCameraD3D::CreateWorldMatrixAndSomeStuff()
 {
@@ -1067,7 +1136,6 @@
   screenCenterY = (double)(pViewport->uScreenCenterY - pViewport->uScreen_TL_Y);
 }
 
-
 //----- (00437691) --------------------------------------------------------
 void IndoorCameraD3D::Vec3Transform(const IndoorCameraD3D_Vec3 *pVector, IndoorCameraD3D_Vec3 *pOut)
 {
@@ -1390,6 +1458,7 @@
   *pOutNumVertices = v5;
   return result;
 }
+
 //----- (00436F09) --------------------------------------------------------
 void IndoorCameraD3D::_436F09_mess_with_lightmap__clipflag_4(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
 {
@@ -1492,7 +1561,6 @@
   }
 }
 
-
 //----- (00436CDC) --------------------------------------------------------
 void IndoorCameraD3D::_436CDC_mess_with_lightmap__clipflag_2(RenderVertexSoft *pInVertices, int uNumInVertices, RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
 {
@@ -1588,7 +1656,6 @@
   }
 }
 
-
 //----- (00436BB7) --------------------------------------------------------
 void IndoorCameraD3D::Project(RenderVertexSoft *pVertices, unsigned int uNumVertices, char a4)
 {
@@ -1658,7 +1725,6 @@
   }
 }
 
-
 //----- (00436A9A) --------------------------------------------------------
 void IndoorCameraD3D::Project(signed int x, signed int y, signed int z, int *a5, int *a6)
 {
@@ -1717,7 +1783,6 @@
   return result;
 }
 
-
 //----- (00436A24) --------------------------------------------------------
 struct IDirect3DTexture2 *IndoorCameraD3D::LoadTextureAndGetHardwarePtr(char *Str1)
 {
--- a/MM7.h	Sun Mar 24 09:18:51 2013 +0600
+++ b/MM7.h	Sun Mar 24 09:19:36 2013 +0600
@@ -262,18 +262,3 @@
 
 
 
-#pragma pack(push, 1)
-struct stru365_travel_info
-{
-  unsigned char uMapInfoID;
-  unsigned char pSchedule[7];
-  unsigned char uTravelTime;
-  unsigned char field_9[3];
-  int field_C;
-  int field_10;
-  int field_14;
-  int field_18;
-  unsigned int  uQuestBit;  // quest bit required to set for this travel option to be enabled; otherwise 0
-};
-#pragma pack(pop)
-extern stru365_travel_info travel_schedule[];
\ No newline at end of file
--- a/MapInfo.h	Sun Mar 24 09:18:51 2013 +0600
+++ b/MapInfo.h	Sun Mar 24 09:19:36 2013 +0600
@@ -19,6 +19,8 @@
   MAP_AVLEE = 14,
   MAP_SHOALS = 15,
   //...
+  MAP_ARENA = 76,
+  //...
 };
 
 
--- a/Mouse.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/Mouse.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -110,12 +110,20 @@
     {
       v10 = 0.0;
       v5 = 0.0;
-LABEL_12:
+//LABEL_12:
       v6 = v5;
       pAsyncMouse->SetHotspot(v6, v10);
-      goto LABEL_18;
+	  if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
+	  {
+		GetCursorPos(&Point);
+		SetCursorPos(Point.x, Point.y);
+	  }
+	  return;
     }
-    goto LABEL_20;
+    GetCursorPos(&Point);
+	ClientToScreen(hWnd,&Point);
+    SetCursorPos(Point.x, Point.y);
+    return;
   }
   if ( !strcmp(pName, "MICON2") )
   {
@@ -126,9 +134,16 @@
     {
       v10 = 14.0;
       v5 = 14.0;
-      goto LABEL_12;
+      v6 = v5;
+      pAsyncMouse->SetHotspot(v6, v10);
+	  if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
+	  {
+		GetCursorPos(&Point);
+		SetCursorPos(Point.x, Point.y);
+	  }
+	  return;
     }
-LABEL_20:
+//LABEL_20:
     GetCursorPos(&Point);
     SetCursorPos(Point.x, Point.y);
     return;
@@ -138,9 +153,12 @@
     v8 = (LONG)LoadCursorA(0, (LPCSTR)IDC_WAIT);
     SetClassLongA(hWnd, -12, v8);
   }
-LABEL_18:
+//LABEL_18:
   if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
-    goto LABEL_20;
+  {
+    GetCursorPos(&Point);
+    SetCursorPos(Point.x, Point.y);
+  }
 }
 // 506128: using guessed type int areWeLoadingTexture;
 
--- a/NPC.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/NPC.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -11,7 +11,6 @@
 #include "MM7.h"
 #include "NPC.h"
 
-
 int pDialogueNPCCount;
 struct Texture *pDialogueNPCPortraits[6];
 int uNumDialogueNPCPortraits; // weak
@@ -25,6 +24,235 @@
 void  InitializeQuests();
 bool   CheckPortretAgainstSex(int portret_num, int sex); 
 
+//----- (004459F9) --------------------------------------------------------
+NPCData *__fastcall GetNPCData(signed int npcid)
+{
+  unsigned int v1; // esi@1
+  NPCData *result; // eax@5
+  int v3; // esi@9
+  int v4; // ecx@9
+  //int v5; // edx@9
+  //NPCData *v6; // eax@9
+  char *v7; // ebx@14
+  NPCData *v8; // edi@14
+  char v9; // al@22
+  char v10;
+  //std::string v10; // [sp-18h] [bp-2Ch]@4
+  int v11;
+  //const char *v11; // [sp-8h] [bp-1Ch]@4
+  int v12; // [sp-4h] [bp-18h]@4
+  int v13; 
+  char *v14;
+  //std::string *v13; // [sp+Ch] [bp-8h]@4
+  int a3; // [sp+13h] [bp-1h]@4
+  int i;
+
+  /*v1 = npcid;
+  if ( (npcid & 0x80000000u) == 0 )
+  {
+    if ( (signed int)npcid < 5000 )
+    {
+      if ( (signed int)npcid >= 501 )
+      {
+    MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
+      }
+      return &pNPCStats->pNewNPCData[v1];
+    }
+    return &pNPCStats->array_13EF4[npcid - 5000];
+  }
+  if ( (signed int)npcid >= 5000 )
+    return &pNPCStats->array_13EF4[npcid - 5000];
+  if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
+  {
+    result = 0;
+  }
+  else
+  {
+    v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
+    v4 = 0;
+    v5 = 0;
+    v6 = pParty->pHirelings;
+    do
+    {
+      if ( v6->pName )
+        pTmpBuf[v4++] = v5;
+      ++v6;
+      ++v5;
+    }
+    while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
+    v13 = 0;
+    if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
+    {
+      v7 = &pTmpBuf[v4];
+      v8 = pNPCStats->pNewNPCData;
+      do
+      {
+        if ( v8->uFlags & 0x80
+          && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
+          && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
+          *v7++ = (char)v13 + 2;
+        v13 = (std::string *)((char *)v13 + 1);
+        ++v8;
+      }
+      while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
+    }
+    v9 = pTmpBuf[v3];
+    if ( (unsigned __int8)v9 >= 2u )
+      result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
+    else
+      result = &pParty->pHirelings[(unsigned __int8)v9];
+  }
+  return result;*/
+  v1 = npcid;
+  if ( npcid >= 0 )
+  {
+    if ( npcid < 5000 )
+    {
+      if ( npcid >= 501 )
+      {
+        MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
+      }
+      return &pNPCStats->pNewNPCData[v1];// - 1];
+    }
+    return &pNPCStats->pAdditionalNPC[npcid - 5000];
+  }
+
+
+  if ( npcid >= 5000 )
+    return &pNPCStats->pAdditionalNPC[npcid - 5000];
+  if (sDialogue_SpeakingActorNPC_ID >= 0)
+  {
+    result = 0;
+  }
+  else
+  {
+    v3 = abs(sDialogue_SpeakingActorNPC_ID) - 1;
+    v4 = 0;
+
+    for (i = 0; i < 2; ++i)
+    {
+      if (pParty->pHirelings[i].pName)
+        pTmpBuf[v4++] = i;
+    }
+
+    if (pNPCStats->uNumNewNPCs > 0)
+    {
+      for (i = 0; i < pNPCStats->uNumNewNPCs; ++i)
+      {
+        if (pNPCStats->pNewNPCData[i].Hired())
+        {
+          if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
+          {
+            if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
+              pTmpBuf[v4++] = i + 2;
+          }
+        }
+      }
+    }
+
+    v9 = pTmpBuf[v3];
+    if ( v9 >= 2 )
+     result = &pNPCStats->pNPCData[499 + v9];
+    else
+      result = &pParty->pHirelings[v9];
+  }
+}
+
+//----- (00445B2C) --------------------------------------------------------
+NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
+{
+  signed int v2; // esi@1
+  int v3; // edi@1
+  NPCData *result; // eax@5
+  int v5; // esi@9
+  int v6; // ecx@9
+  int v7; // edx@9
+  NPCData *v8; // eax@9
+  NPCData *v9; // edi@14
+  int v10; // ecx@20
+  char v11; // al@23
+  std::string v12; // [sp-18h] [bp-34h]@4
+  const char *v13; // [sp-8h] [bp-24h]@4
+  int v14; // [sp-4h] [bp-20h]@4
+  std::string *v15; // [sp+Ch] [bp-10h]@1
+  char *v16; // [sp+10h] [bp-Ch]@14
+  int v17; // [sp+14h] [bp-8h]@13
+  int a3; // [sp+1Bh] [bp-1h]@4
+
+  v2 = npcid;
+  v3 = a2;
+  v15 = (std::string *)a2;
+  if ( npcid >= 0 )
+  {
+    if ( npcid < 5000 )
+    {
+      if ( npcid >= 501 )
+      {
+    MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:2040", 0);
+      }
+      *(int *)v3 = v2;
+      return &pNPCStats->pNewNPCData[v2];
+    }
+LABEL_7:
+    *(int *)a2 = npcid - 5000;
+    return &pNPCStats->pAdditionalNPC[npcid - 5000];
+  }
+  if ( npcid >= 5000 )
+    goto LABEL_7;
+  if ( sDialogue_SpeakingActorNPC_ID >= 0 )
+  {
+    *(int *)a2 = 0;
+    result = 0;
+  }
+  else
+  {
+    v5 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
+    v6 = 0;
+    v7 = 0;
+    v8 = pParty->pHirelings;
+    do
+    {
+      if ( v8->pName )
+        pTmpBuf[v6++] = v7;
+      ++v8;
+      ++v7;
+    }
+    while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
+    v17 = 0;
+    if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
+    {
+      v9 = pNPCStats->pNewNPCData;
+      v16 = &pTmpBuf[v6];
+      do
+      {
+        if ( v9->Hired()
+          && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
+          && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
+        {
+          v10 = (int)v16++;
+          *(char *)v10 = v17 + 2;
+        }
+        ++v17;
+        ++v9;
+      }
+      while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
+      v3 = (int)v15;
+    }
+    v11 = pTmpBuf[v5];
+    if ( (unsigned __int8)v11 >= 2u )
+    {
+      *(int *)v3 = (unsigned __int8)v11 - 2;
+      result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
+    }
+    else
+    {
+      *(int *)v3 = (unsigned __int8)v11;
+      result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
+    }
+  }
+  return result;
+}
+
 //----- (00476977) --------------------------------------------------------
 void NPCStats::InitializeNPCText()
 	{
--- a/Party.h	Sun Mar 24 09:18:51 2013 +0600
+++ b/Party.h	Sun Mar 24 09:19:36 2013 +0600
@@ -10,6 +10,7 @@
 
 enum PARTY_QUEST_BITS: unsigned __int32
 {
+  PARTY_QUEST_EVENMORN_MAP_FOUND = 64,
   PARTY_QUEST_FOUNTAIN_HARMONDALE = 206,
   PARTY_QUEST_FOUNTAIN_NIGHON = 207,
   PARTY_QUEST_FOUNTAIN_PIERPONT = 208,
--- a/Random.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/Random.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -7,7 +7,7 @@
 
 
 
-struct Random *pRnd; // idb
+struct Random *pRnd=new Random(); // idb
 
 
 
--- a/Render.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/Render.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -22,19 +22,11 @@
 #include "Log.h"
 #include "TileFrameTable.h"
 #include "texts.h"
-
 #include "mm7_data.h"
 
-
 #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib")
 #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib")
 
-
-
-
-
-
-
 struct IDirectDrawClipper *pDDrawClipper;
 struct Render *pRenderer; // idb
 struct RenderVertexD3D3  pVertices[50];
@@ -43,7 +35,6 @@
 unsigned int uNumBillboardsToDraw;
 int uNumSpritesDrawnThisFrame; // weak
 
-
 RenderVertexSoft array_507D30[50];
 RenderVertexSoft array_508690[50];
 RenderVertexSoft array_508FF0[50];
@@ -61,15 +52,8 @@
 RenderVertexSoft pVerticesSR_801A10[384];
 RenderVertexSoft pVerticesSR_806210[384];
 
-
-
-
-
-
-
 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1);
 
-
 /*  384 */
 #pragma pack(push, 1)
 struct PCXHeader_1
@@ -98,29 +82,11 @@
 };
 #pragma pack(pop)
 
-
-
-
-
-
-
-
 HRESULT __stdcall D3DZBufferFormatEnumerator(DDPIXELFORMAT *Src, DDPIXELFORMAT *Dst);
 HRESULT __stdcall DDrawDisplayModesEnumerator(DDSURFACEDESC2 *pSurfaceDesc, __int16 *a2);
 HRESULT __stdcall D3DDeviceEnumerator(const GUID *lpGUID, const char *lpDeviceDesc, const char *lpDeviceName, D3DDEVICEDESC *pHWDesc, D3DDEVICEDESC *pSWDesc, struct RenderD3D_aux *a6);
 signed int __stdcall RenderD3D__DeviceEnumerator(GUID *lpGUID, const char *lpDevDesc, const char *lpDriverName, RenderD3D__DevInfo *pOut); // idb
 
-
-
-
-
-
-
-
-
-
-
-
 //----- (0049E79F) --------------------------------------------------------
 bool __cdecl CheckTextureStages()
 {
@@ -163,18 +129,6 @@
   return v0;
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
 //----- (00440CB8) --------------------------------------------------------
 void Render::DrawBillboardList_BLV()
 {
@@ -224,10 +178,6 @@
   }
 }
 
-
-
-
-
 //----- (004A16A5) --------------------------------------------------------
 bool __cdecl AreRenderSurfacesOk()
 {
@@ -256,8 +206,6 @@
   return result;
 }
 
-
-
 //----- (00487389) --------------------------------------------------------
 __int16 Render::ExecOutdoorDrawSW()
 {
@@ -2476,8 +2424,6 @@
 // 4D864C: using guessed type char byte_4D864C;
 // 76D5C0: using guessed type char static_sub_0048034E_byte_76D5C0__init_flag;
 
-
-
 //----- (00481212) --------------------------------------------------------
 void Render::DrawTerrainSW(int a1, int a2, int a3)
 {
@@ -2976,7 +2922,6 @@
   }
 }
 
-
 //----- (0047BACF) --------------------------------------------------------
 void Render::TransformBillboardsAndSetPalettesODM()
 {
@@ -3056,7 +3001,6 @@
   }
 }
 
-
 //----- (0047AF11) --------------------------------------------------------
 void Render::DrawSpriteObjects_ODM()
 {
@@ -3263,7 +3207,6 @@
 // 4E94D3: using guessed type char byte_4E94D3;
 // 5187E4: using guessed type int uNumSpritesDrawnThisFrame;
 
-
 //----- (0049D9BC) --------------------------------------------------------
 signed int __stdcall RenderD3D__DeviceEnumerator(GUID *lpGUID, const char *lpDevDesc, const char *lpDriverName, RenderD3D__DevInfo *pOut)
 {
@@ -3383,7 +3326,6 @@
   return 1;
 }
 
-
 //----- (0049D784) --------------------------------------------------------
 HRESULT __stdcall D3DDeviceEnumerator(const GUID *lpGUID, const char *lpDeviceDesc, const char *lpDeviceName, D3DDEVICEDESC *pHWDesc, D3DDEVICEDESC *pSWDesc, RenderD3D_aux *a6)
 {
@@ -3461,7 +3403,6 @@
   return 1;
 }
 
-
 //----- (0049D75C) --------------------------------------------------------
 HRESULT __stdcall DDrawDisplayModesEnumerator(DDSURFACEDESC2 *pSurfaceDesc, __int16 *a2)
 {
@@ -3479,8 +3420,6 @@
   return result;
 }
 
-
-
 //----- (0047A95E) --------------------------------------------------------
 void Render::PrepareDecorationsRenderList_ODM()
 {
@@ -3803,7 +3742,6 @@
 // 4E94D0: using guessed type char byte_4E94D0;
 // 5187EC: using guessed type int uNumDecorationsDrawnThisFrame;
 
-
 //----- (0049D717) --------------------------------------------------------
 HRESULT __stdcall D3DZBufferFormatEnumerator(DDPIXELFORMAT *Src, DDPIXELFORMAT *Dst)
 {
@@ -3836,7 +3774,6 @@
   DirectDrawEnumerateA((LPDDENUMCALLBACKA)RenderD3D__DeviceEnumerator, *pOutDevices);
 }
 
-
 //----- (0049DC58) --------------------------------------------------------
 RenderD3D::RenderD3D()
 {
@@ -3978,7 +3915,6 @@
   }
 }
 
-
 //----- (0049DE14) --------------------------------------------------------
 bool RenderD3D::CreateDevice(unsigned int uDeviceID, int bWindowed, HWND hWnd)
 {
@@ -4254,7 +4190,6 @@
   return 1;
 }
 
-
 //----- (0049E444) --------------------------------------------------------
 unsigned int RenderD3D::GetDeviceCaps()
 {
@@ -4297,7 +4232,6 @@
   return result;
 }
 
-
 //----- (0049E4FC) --------------------------------------------------------
 void RenderD3D::ClearTarget(unsigned int bClearColor, unsigned int uClearColor, unsigned int bClearDepth, float z_clear)
 {
@@ -4313,7 +4247,6 @@
     pViewport->Clear2(1, rects, uClearFlags, uClearColor, z_clear, 0);
 }
 
-
 //----- (0049E54D) --------------------------------------------------------
 void RenderD3D::Present(bool bForceBlit)
 {
@@ -4339,7 +4272,6 @@
     pFrontBuffer->Flip(0, 1);
 }
 
-
 //----- (0049E5D4) --------------------------------------------------------
 bool RenderD3D::CreateTexture(unsigned int uTextureWidth, unsigned int uTextureHeight, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture, bool bAlphaChannel, bool bMipmaps, unsigned int uMinDeviceTexDim)
 {
@@ -4430,8 +4362,6 @@
   pSprites_LOD->ReleaseLostHardwareSprites();
 }
 
-
-
 //----- (004A2050) --------------------------------------------------------
 void Render::DrawPolygon(unsigned int uNumVertices, stru148 *a3, ODMFace *a4, IDirect3DTexture2 *pTexture)
 {
@@ -4693,7 +4623,6 @@
 }
 // 4D864C: using guessed type char byte_4D864C;
 
-
 //----- (0049EB79) --------------------------------------------------------
 Render::~Render()
 {
@@ -4709,8 +4638,6 @@
   //nullsub_1();
 }
 
-
-
 //----- (0049E756) --------------------------------------------------------
 bool Render::IsColorKeySupported(IDirectDraw4 *this_)
 {
@@ -4785,8 +4712,7 @@
   hd_water_current_frame = 0;
 }
 
-bool Render::Initialize(bool bWindowed, uint uDefaultDevice,
-                        bool bColoredLights, uint uDetailLevel, uint bTinting)
+bool Render::Initialize(bool bWindowed, uint uDefaultDevice, bool bColoredLights, uint uDetailLevel, uint bTinting)
 {
   bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0);
   bStartInWindow = bWindowed;
@@ -4804,8 +4730,6 @@
   return r1 && r2;
 }
 
-
-
 //----- (0049EBF1) --------------------------------------------------------
 void Render::_49EBF1()
 {
@@ -4856,7 +4780,6 @@
   }
 }
 
-
 //----- (0049ECC4) --------------------------------------------------------
 void Render::ClearBlack()
 {
@@ -4869,7 +4792,6 @@
     memset(pRenderer->pTargetSurface, 0, 4 * (field_10 * field_14 / 2));
 }
 
-
 //----- (0049ED18) --------------------------------------------------------
 void Render::PresentBlackScreen()
 {
@@ -4903,7 +4825,6 @@
   pRenderer->Present();
 }
 
-
 //----- (0049EDB6) --------------------------------------------------------
 void Render::SavePCXScreenshot()
 {
@@ -5088,7 +5009,6 @@
 }
 // 4EFA80: using guessed type int dword_4EFA80;
 
-
 //----- (0049F1BC) --------------------------------------------------------
 void Render::_49F1BC(const char *a1)
 {
@@ -5283,8 +5203,6 @@
 }
 // 4EFA84: using guessed type int dword_4EFA84;
 
-
-
 //----- (0049F5A2) --------------------------------------------------------
 int Render::_49F5A2(int a2, int a3, int a4, void *Dst, int a6, int a7)
 {
@@ -5456,7 +5374,6 @@
   return result;
 }
 
-
 //----- (0049F8B5) --------------------------------------------------------
 FILE *Render::SavePCXImage(const char *Filename, char *a3, int a4, int a5)
 {
@@ -5593,7 +5510,6 @@
   return result;
 }
 
-
 //----- (0049FBCD) --------------------------------------------------------
 void Render::ClearTarget(unsigned int uColor)
 {
@@ -5606,8 +5522,6 @@
     memset32(pTargetSurface, uColor, field_10 * field_14 / 2);
 }
 
-
-
 //----- (0049FC23) --------------------------------------------------------
 void Render::Release2()
 {
@@ -5615,7 +5529,6 @@
   bWindowMode = 1;
 }
 
-
 //----- (0049FC37) --------------------------------------------------------
 void Render::Present()
 {
@@ -5694,7 +5607,6 @@
   }
 }
 
-
 //----- (0049FDBF) --------------------------------------------------------
 void Render::CreateZBuffer()
 {
@@ -5706,7 +5618,6 @@
   }
 }
 
-
 //----- (0049FE05) --------------------------------------------------------
 void Render::Release()
 {
@@ -6059,7 +5970,6 @@
 }
 // 6BE3A0: using guessed type float flt_6BE3A0;
 
-
 //----- (004A05F3) --------------------------------------------------------
 bool Render::SwitchToWindow(HWND hWnd)
 {
@@ -6292,7 +6202,6 @@
   return 0;
 }
 
-
 //----- (004A0BEE) --------------------------------------------------------
 char Render::RasterLine2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor)
 {
@@ -6526,16 +6435,12 @@
   return v12;
 }
 
-
-
 //----- (004A0E80) --------------------------------------------------------
 void Render::ClearZBuffer(int a2, int a3)
 {
   memset32(this->pActiveZBuffer, -65536, 0x4B000u);
 }
 
-
-
 //----- (004A0E97) --------------------------------------------------------
 void Render::SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
 {
@@ -6545,7 +6450,6 @@
   this->raster_clip_w = uW;
 }
 
-
 //----- (004A0EB6) --------------------------------------------------------
 void Render::ParseTargetPixelFormat()
 {
@@ -6660,7 +6564,6 @@
   return result;
 }
 
-
 //----- (004A1032) --------------------------------------------------------
 bool Render::LockSurface_DDraw2(IDirectDrawSurface2 *pSurface, DDSURFACEDESC *pDesc, unsigned int uLockFlags)
 {
@@ -6991,7 +6894,6 @@
   return bUserDirect3D == 0;
 }
 
-
 //----- (004A16E1) --------------------------------------------------------
 void Render::UnlockBackBuffer()
 {
@@ -7001,7 +6903,6 @@
     ErrD3D(pBackBuffer2->Unlock(0));
 }
 
-
 //----- (004A172E) --------------------------------------------------------
 void Render::LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow)
 {
@@ -7054,7 +6955,6 @@
   ErrD3D(pFront->Unlock(0));
 }
 
-
 //----- (004A1814) --------------------------------------------------------
 void Render::RestoreFrontBuffer()
 {
@@ -7067,7 +6967,6 @@
     (*v1)->Restore();
 }
 
-
 //----- (004A184C) --------------------------------------------------------
 HRESULT Render::_4A184C()
 {
@@ -7121,7 +7020,6 @@
   ErrD3D(pFront->Blt(a2, pBack, v6, v7, v8));
 }
 
-
 //----- (004A18F5) --------------------------------------------------------
 void Render::BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags)
 {
@@ -7238,7 +7136,6 @@
   return v7;
 }
 
-
 //----- (004A1E9D) --------------------------------------------------------
 unsigned int Render::GetBillboardDrawListSize()
 {
@@ -7312,8 +7209,6 @@
     pGame->pStru6Instance->RenderSpecialEffects();
 }
 
-
-
 //----- (004A2031) --------------------------------------------------------
 unsigned int Render::GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6)
 {
@@ -7718,7 +7613,6 @@
         pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_D3D_OUTLINES )
       pGame->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0);
   }
-
 // 4A26BC: could not find valid save-restore pair for esi
 // 4D864C: using guessed type char byte_4D864C;
 
@@ -7766,6 +7660,7 @@
   pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT);
  }
 }
+
 //----- (004A2DA3) --------------------------------------------------------
 void Render::DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture)
 {
@@ -7810,7 +7705,6 @@
   }
 }
 
-
 //----- (004A2ED5) --------------------------------------------------------
 void Render::_4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex)
 {
@@ -7866,8 +7760,6 @@
   }
 }
 
-
-
 //----- (004A2FC0) --------------------------------------------------------
 void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8)
 {
@@ -8075,7 +7967,6 @@
 }
 // 4D864C: using guessed type char byte_4D864C;
 
-
 //----- (004A43B1) --------------------------------------------------------
 void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level)
 {
@@ -8204,8 +8095,6 @@
   }
 }
 
-
-
 //----- (004A354F) --------------------------------------------------------
 void Render::MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle)
 {
@@ -8381,7 +8270,6 @@
   }
 }
 
-
 //----- (004A3AD9) --------------------------------------------------------
 void Render::MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle)
 {
@@ -8554,7 +8442,6 @@
   }
 }
 
-
 //----- (004A4023) --------------------------------------------------------
 void Render::TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard)
 {
@@ -8660,7 +8547,6 @@
     pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Transparent;
 }
 
-
 //----- (004A48E4) --------------------------------------------------------
 int Render::MakeParticleBillboardAndPush_BLV_Software(int screenSpaceX, int screenSpaceY, int z, int lightColor, int a6)
 {
@@ -8854,7 +8740,6 @@
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW));
 }
 
-
 //----- (004A4CC9) --------------------------------------------------------
 void Render::_4A4CC9(stru6_stru1_indoor_sw_billboard *a1, int a2)
 {
@@ -8932,7 +8817,6 @@
   }
 }
 
-
 //----- (004A4DE1) --------------------------------------------------------
 bool Render::LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture)
 {
@@ -9186,7 +9070,6 @@
   }
 }
 
-
 //----- ( ) --------------------------------------------------------
 unsigned int Render::_4A52F1(unsigned int this_, float a3)
 {
@@ -9394,8 +9277,6 @@
   return result;
 }
 
-
-
 //----- (004A5B81) --------------------------------------------------------
 void Render::SetTextureClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
 {
@@ -9406,7 +9287,6 @@
   this->uClipZ = uZ;
 }
 
-
 //----- (004A5BB6) --------------------------------------------------------
 void Render::ResetTextureClipRect()
 {
@@ -9417,7 +9297,6 @@
   this->uClipZ = 640;
 }
 
-
 //----- (004A5BE3) --------------------------------------------------------
 void Render::DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4)
 {
@@ -9521,7 +9400,6 @@
   }
 }
 
-
 //----- (004A5D33) --------------------------------------------------------
 void Render::_4A5D33(unsigned int pX, unsigned int pY, int a4, int a5, RGBTexture *pTexture)
 {
@@ -9634,8 +9512,6 @@
   }
 }
 
-
-
 //----- (004A6E7E) --------------------------------------------------------
 void Render::_4A6E7E(unsigned int a2, unsigned int a3, Texture *a4)
 {
@@ -9768,7 +9644,6 @@
   }
 }
 
-
 //----- (004A6DF5) --------------------------------------------------------
 int Render::_4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, Vec2_int_ *pBitmapXY, unsigned __int16 *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7)
 {
@@ -9818,7 +9693,6 @@
   return result;
 }
 
-
 //----- (004A6D87) --------------------------------------------------------
 void Render::FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16)
 {
@@ -9836,8 +9710,6 @@
     }
 }
 
-
-
 //----- (004A6C4F) --------------------------------------------------------
 void Render::DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor)
 {
@@ -9937,8 +9809,6 @@
   }
 }
 
-
-
 //----- (004A6A68) --------------------------------------------------------
 void Render::_4A6A68(unsigned int a2, unsigned int a3, Texture *a4, __int16 height)
 {
@@ -9957,8 +9827,6 @@
     DrawTextureIndexed(a2, a3, &tex);
 }
 
-
-
 //----- (004A6AB1) --------------------------------------------------------
 void Render::DrawTextPalette(int x, int y, int a4, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8)
 {
@@ -10209,7 +10077,6 @@
   }
 }
 
-
 //----- (004A6776) --------------------------------------------------------
 void Render::DrawTransparentRedShade(unsigned int a2, unsigned int a3, Texture *a4)
 {
@@ -10425,7 +10292,6 @@
   }
 }
 
-
 //----- (004A63E6) --------------------------------------------------------
 void Render::_4A63E6(unsigned int a2, unsigned int a3, Texture *a4, Texture *a5, int a6, int a7, int a8)
 {
@@ -10549,7 +10415,6 @@
   }
 }
 
-
 //----- (004A6274) --------------------------------------------------------
 void Render::DrawTextureTransparent(unsigned int uX, unsigned int uY, Texture *pTexture)
 {
@@ -10658,7 +10523,6 @@
   }
 }
 
-
 //----- (004A612A) --------------------------------------------------------
 void Render::DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal)
 {
@@ -10764,7 +10628,6 @@
   }
 }
 
-
 //----- (004A601E) --------------------------------------------------------
 void Render::_4A601E(signed int a2, signed int a3, Texture *pTexture, int a5)
 {
@@ -11104,14 +10967,12 @@
 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
 // A74C88: using guessed type int dword_A74C88;
 
-
 //----- (0044EC20) --------------------------------------------------------
 bool RenderD3D::DoesRaiseExceptions()
 {
   return true;
 }
 
-
 //----- (0040DBD3) --------------------------------------------------------
 void __fastcall Render::SetPixel(Vec2_int_ *pTargetXY, unsigned __int16 uColor)
 {
@@ -11142,7 +11003,6 @@
   }
 }
 
-
 //----- (004524D8) --------------------------------------------------------
 HWLTexture *RenderHWLContainer::LoadTexture(const char *pName, int bMipMaps)
 {
@@ -11383,14 +11243,6 @@
   return true;
 }
 
-
-
-
-
-
-
-
-
 //----- (004A1C1E) --------------------------------------------------------
 void DoRenderBillboards_D3D()
 {
@@ -11459,10 +11311,6 @@
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, TRUE));
 }
 
-
-
-
-
 //----- (004A1DA8) --------------------------------------------------------
 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1)
 {
--- a/SpriteObject.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/SpriteObject.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -14,17 +14,31 @@
 #include "LOD.h"
 #include "Actor.h"
 #include "Events.h"
-
 #include "mm7_data.h"
 
-
-
-
 size_t uNumSpriteObjects;
 SpriteObject pSpriteObjects[1000];
 
-
-
+//----- (00404828) --------------------------------------------------------
+SpriteObject::SpriteObject()
+{
+  field_22_glow_radius_multiplier = 1;
+  uSoundID = 0;
+  uFacing = 0;
+  vVelocity.z = 0;
+  vVelocity.y = 0;
+  vVelocity.x = 0;
+  uType = 0;
+  uObjectDescID = 0;
+  field_61 = 0;
+  field_60_distance_related_prolly_lod = 0;
+  field_20 = 0;
+  uSpriteFrameID = 0;
+  field_50 = 0;
+  field_4C = 0;
+  field_48 = 0;
+  field_54 = 0;
+}
 
 //----- (0042F5ED) --------------------------------------------------------
 int SpriteObject::Create(int yaw, int pitch, int a4, int a5)
@@ -165,8 +179,6 @@
   return v6;
 }
 
-
-
 //----- (00471C03) --------------------------------------------------------
 void SpriteObject::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
 {
@@ -589,8 +601,6 @@
   }
 }
 
-
-
 //----- (0047136C) --------------------------------------------------------
 void SpriteObject::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
 {
@@ -975,9 +985,6 @@
 }
 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
 
-
-
-
 //----- (00438E35) --------------------------------------------------------
 void SpriteObject::_438E35()
 {
@@ -1070,8 +1077,6 @@
   }
 }
 
-
-
 //----- (0042F933) --------------------------------------------------------
 void SpriteObject::OnInteraction(unsigned int uLayingItemID)
 {
--- a/UIHouses.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/UIHouses.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -1,5 +1,4 @@
 #include "UIHouses.h"
-
 #include "Party.h"
 #include "Player.h"
 #include "texts.h"
@@ -21,11 +20,12 @@
 #include "Viewport.h"
 #include "Keyboard.h"
 #include "NPC.h"
-
+#include "IndoorCamera.h"
+#include "MapInfo.h"
+#include "Log.h"
 #include "MM7.h"
 #include "mm7_data.h"
 
-
 int uHouse_ExitPic; // weak
 
 int dword_591080; // weak
@@ -33,8 +33,88 @@
 int in_current_building_type; // 00F8B198
 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
 
+#pragma pack(push, 1)
+struct stru365_travel_info
+{
+  unsigned char uMapInfoID;
+  unsigned char pSchedule[7];
+  unsigned int uTravelTime;
+  int arrival_x;
+  int arrival_y;
+  int arrival_z;
+  int arrival_rot_y;
+  unsigned int  uQuestBit;  // quest bit required to set for this travel option to be enabled; otherwise 0
+};
+#pragma pack(pop)
+stru365_travel_info transport_schedule[35] =  // 004F09B0
+{
+  {MAP_STEADWICK,       {1, 0, 1, 0, 1, 0, 0},  2,  -18048,    4636,   833,  1536,  0},
+  {MAP_PIERPONT,        {0, 1, 0, 1, 0, 1, 0},  2,   -2527,   -6773,  1153,   896,  0},
+  {MAP_TATALIA,         {1, 0, 1, 0, 1, 0, 0},  2,    4730,  -10580,   320,  1024,  0},
+  {MAP_HARMONDALE,      {0, 1, 0, 1, 0, 1, 0},  2,   -5692,   11137,     1,  1024,  0},
+  {MAP_DEYJA,           {1, 0, 0, 1, 0, 0, 0},  3,    7227,  -16007,  2625,   640,  0},
+  {MAP_BRAKADA_DESERT,  {0, 0, 1, 0, 0, 1, 0},  3,    8923,   17191,     1,   512,  0},
+  {MAP_AVLEE,           {1, 0, 1, 0, 1, 0, 0},  3,   17059,   12331,   512,  1152,  0},
+  {MAP_DEYJA,           {0, 1, 0, 0, 1, 0, 1},  2,    7227,  -16007,  2625,   640,  0},
+  {MAP_HARMONDALE,      {0, 1, 0, 1, 0, 1, 0},  2,   -5692,   11137,     1,  1024,  0},
+  {MAP_STEADWICK,       {1, 0, 1, 0, 1, 0, 0},  3,  -18048,    4636,   833,  1536,  0},
+  {MAP_PIERPONT,        {0, 1, 0, 1, 0, 1, 0},  2,   -2527,   -6773,  1153,   896,  0},
+  {MAP_STEADWICK,       {1, 0, 1, 0, 1, 0, 1},  3,  -18048,    4636,   833,  1536,  0},
+  {MAP_HARMONDALE,      {0, 1, 0, 0, 0, 1, 0},  5,   -5692,   11137,     1,  1024,  0},
+  {MAP_STEADWICK,       {0, 1, 0, 1, 0, 1, 0},  2,  -18048,    4636,   833,  1536,  0},
+  {MAP_PIERPONT,        {0, 1, 0, 1, 0, 1, 0},  3,   -2527,  -16007,  1153,   896,  0},
+  {MAP_DEYJA,           {0, 0, 1, 0, 0, 0, 1},  5,    7227,  -16007,  2625,   640,  0},
+  {MAP_TATALIA,         {0, 1, 0, 1, 0, 1, 0},  2,   -2183,   -6941,    97,     0,  0},
+  {MAP_AVLEE,           {1, 0, 0, 0, 1, 0, 0},  4,    7913,    9476,   193,     0,  0},
+  {MAP_EVENMORN_ISLE,   {0, 0, 0, 0, 0, 0, 1},  7,   15616,    6390,   193,  1536,  PARTY_QUEST_EVENMORN_MAP_FOUND},
+  {MAP_BRAKADA_DESERT,  {0, 0, 1, 0, 0, 0, 0},  6,   19171,  -19722,   193,  1024,  0},
+  {MAP_AVLEE,           {0, 1, 0, 1, 0, 1, 0},  3,    7913,    9476,   193,     0,  0},
+  {MAP_BRAKADA_DESERT,  {1, 0, 1, 0, 0, 0, 0},  6,   19171,  -19722,   193,  1024,  0},
+  {MAP_TATALIA,         {1, 0, 1, 0, 1, 0, 0},  4,   -2183,   -6941,    97,     0,  0},
+  {MAP_PIERPONT,        {0, 0, 0, 0, 0, 1, 0},  6,    -709,  -14087,   193,  1024,  0},
+  {MAP_STEADWICK,       {0, 0, 0, 0, 0, 0, 1},  6,  -10471,   13497,   193,  1536,  0},
+  {MAP_EVENMORN_ISLE,   {0, 1, 0, 1, 0, 0, 0},  1,   15616,    6390,   193,  1536,  PARTY_QUEST_EVENMORN_MAP_FOUND},
+  {MAP_BRAKADA_DESERT,  {0, 1, 0, 1, 0, 0, 0},  1,   19171,  -19722,   193,  1024,  0},
+  {MAP_STEADWICK,       {0, 1, 0, 1, 0, 1, 0},  2,  -10471,   13497,   193,  1536,  0},
+  {MAP_BRAKADA_DESERT,  {1, 0, 1, 0, 0, 0, 0},  4,   19171,  -19722,   193,  1024,  0},
+  {MAP_EVENMORN_ISLE,   {0, 0, 0, 0, 0, 0, 1},  5,   15616,    6390,   193,  1536,  PARTY_QUEST_EVENMORN_MAP_FOUND},
+  {MAP_AVLEE,           {0, 0, 0, 0, 1, 0, 0},  5,    7913,    9476,   193,     0,  0},
+  {MAP_STEADWICK,       {0, 1, 0, 0, 0, 1, 0},  4,  -10471,   13497,   193,  1536,  0},
+  {MAP_PIERPONT,        {1, 0, 1, 0, 1, 0, 0},  3,    -709,  -14087,   193,  1024,  0},
+  {MAP_TATALIA,         {0, 0, 0, 1, 0, 0, 0},  5,   -2183,   -6941,    97,     0,  0},
+  {MAP_ARENA,           {0, 0, 0, 0, 0, 0, 1},  4,    3844,    2906,   193,  512,   0}
+};
+
+unsigned char transport_routes[20][4] =
+{
+  {  0,   1,   1,  34},  // HOUSE_STABLES_HARMONDALE
+  {  2,   3,   4,   5},  // HOUSE_STABLES_STEADWICK
+  {  6,   7,   8,   8},  // HOUSE_STABLES_56
+  {  9,  10,  10,  10},  // HOUSE_STABLES_57
+  { 11,  11,  12,  12},  // HOUSE_STABLES_58
+  { 13,  13,  13,  13},  // HOUSE_STABLES_59
+  { 14,  14,  15,  15},  // HOUSE_STABLES_60
+  {255, 255, 255, 255},  // HOUSE_STABLES_61
+  {255, 255, 255, 255},  // HOUSE_STABLES_62
+  {255, 255, 255, 255},  // HOUSE_BOATS_63
+  { 16,  17,  18,  19},  // HOUSE_BOATS_64
+  { 18,  20,  21,  21},  // HOUSE_BOATS_65
+  { 22,  23,  24,  25},  // HOUSE_BOATS_66
+  { 22,  22,  23,  23},  // HOUSE_BOATS_67
+  {255, 255, 255, 255},  // HOUSE_BOATS_68
+  { 27,  28,  29,  30},  // HOUSE_BOATS_69
+  { 31,  32,  33,  33},  // HOUSE_BOATS_70
+  { 24,  24,  24,  24},  // HOUSE_BOATS_71
+  {255, 255, 255, 255},  // HOUSE_BOATS_72
+  {255, 255, 255, 255}   // HOUSE_BOATS_73
+};
+
+
+
+
+
 const stru159 pAnimatedRooms[196] = //0x4E5F70
-    {
+{
         {"",                            0x4, 0x1F4, 0, 0, 0},
         {"Human Armor01",               0x20, 0x2C0, 2, 58, 0},
         {"Necromancer Armor01",         0x20, 0x2D7, 2, 70, 0 },
@@ -231,8 +311,7 @@
         {"Human Temple02",              0x24, 0x3AB, 23, 27, 0 },
         {"Player Castle Good",          0x24, 0, 25, 0, 0 },
         {"Player Castle Bad",           0x24, 0, 25, 0, 0}
-    };
-
+};
 
 
 
@@ -550,32 +629,1420 @@
 
 
 
+
+//----- (004BCACC) --------------------------------------------------------
+void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
+{
+  //unsigned int v1; // edi@1
+  //signed int v2; // ebx@1
+  //signed int v3; // ecx@2
+  int v4; // eax@5
+  signed int v5; // esi@5
+  //Player *v6; // ecx@5
+  //signed int v7; // edx@5
+  GUIWindow *v8; // esi@10
+  unsigned int v9; // eax@12
+  int v10; // esi@31
+  int v11; // edi@31
+  int v12; // esi@32
+  __int16 v13; // bp@32
+  int v14; // edx@32
+  GUIWindow *v15; // eax@32
+  int v16; // eax@32
+  int v17; // eax@33
+  int v18; // eax@34
+  int v19; // eax@35
+  __int16 v20; // ax@37
+  __int16 v21; // ax@76
+  __int16 v22; // ax@107
+  __int16 v23; // ax@132
+  __int16 v24; // ax@163
+  int v25; // esi@190
+  __int16 v26; // ax@190
+  char v27; // zf@190
+  Player *v28; // edi@192
+  int v29; // eax@204
+  void *v30; // esi@208
+  unsigned __int64 v31; // qax@208
+  signed int v32; // edi@209
+  int v33; // eax@210
+  unsigned int v34; // eax@211
+  Player *v35; // edi@227
+  signed int v36; // esi@227
+  int v37; // ecx@227
+  int v38; // esi@230
+  int v39; // edx@235
+  int v40; // edi@243
+  unsigned __int64 v41; // qax@243
+  void *v42; // eax@244
+  signed int v43; // edi@244
+  int v44; // edx@244
+  int v45; // eax@246
+  unsigned int v46; // eax@247
+  void *v47; // eax@250
+  signed int v48; // edi@250
+  int v49; // eax@252
+  int v50; // eax@256
+  unsigned int v51; // eax@257
+  void *v52; // eax@260
+  signed int v53; // edi@260
+  int v54; // eax@262
+  //signed int v55; // [sp+10h] [bp-10h]@1
+  int v56; // [sp+14h] [bp-Ch]@31
+
+  //v1 = 0;
+  //v2 = a1;
+  //v55 = a1;
+  if ( !pDialogueWindow->pNumPresenceButton )
+    return;
+  pRenderer->ClearZBuffer(0, 479);
+  //v3 = dword_F8B198;
+  if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
+  {
+	v8 = window_SpeakInHouse;
+  }
+  //else
+  if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
+  {
+	  if ( in_current_building_type == BildingType_Training )
+	  {
+		if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
+		{
+		  v4 = 0;
+		  v5 = 0;
+		  //v6 = pPlayers[uActiveCharacter];
+		  //v7 = pPlayers[uActiveCharacter]->uLevel;
+		  if ( pPlayers[uActiveCharacter]->uLevel > 0 )
+		  {
+			do
+			  v4 += v5++ + 1;
+			while ( v5 < pPlayers[uActiveCharacter]->uLevel );
+		  }
+		  if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
+			  (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
+			return;
+		}
+		pDialogueWindow->Release();
+		pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
+		pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
+					                                    pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
+		pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr);
+//	LABEL_10:
+		//v3 = dword_F8B198;
+		v8 = window_SpeakInHouse;
+	  }
+	  //else
+	  if ( in_current_building_type != BildingType_Training )
+	  {
+		  v8 = window_SpeakInHouse;
+		  if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
+			  transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
+			|| in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
+		  {
+		//LABEL_9:
+			pDialogueWindow->Release();
+			pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
+			pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
+						                                    pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
+			pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr);
+	//	LABEL_10:
+			//v3 = dword_F8B198;
+			v8 = window_SpeakInHouse;
+		  }
+		  else if (uActiveCharacter)
+		  {
+			if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
+			  return;
+			v8 = window_SpeakInHouse;
+		  }
+	  }
+	//LABEL_11:
+	  dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
+	  if ( in_current_building_type < BildingType_19 )
+	  {
+		v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
+		//v3 = dword_F8B198;
+		ShopTexture = &pIcons_LOD->pTextures[v9];
+	//LABEL_13:
+		v8 = window_SpeakInHouse;
+	  }
+  }
+  
+  //NEW
+  switch(in_current_building_type)
+  {
+	case 5:
+	case 6:
+	case 7:
+	case 8:
+	case 9:
+	case 10:
+	case 11:
+	case 12:
+	case 13:
+	case 14:
+	case 15:
+	case 16:
+		{
+        if ( (signed __int64)__PAIR__(
+                                *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
+                                *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
+        {
+			v32 = 0;
+			do
+			{
+				//v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
+				v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
+				if ( v33 )
+				{
+				v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
+				v8 = window_SpeakInHouse;
+				ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
+				}
+				++v32;
+			}
+			while ( v32 < 12 );
+        }
+        else
+        {
+			SpellBookGenerator();
+			v30 = window_SpeakInHouse->ptr_1C;
+			v31 = pParty->uTimePlayed
+				+ (signed __int64)((double)(0xA8C000
+											//* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
+											* (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
+									* 0.033333335);
+			*(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
+			*(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
+        }
+        return;
+		break;
+		}
+	case 17:
+		{
+		if ( uMessageParam == 99 )
+		{
+			v10 = (int)((char *)v8->ptr_1C - 102);
+			v56 = v10;
+			v11 = 8 * v10 + 11325428;
+			if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
+			{
+				v13 = 0;
+			}
+			else
+			{
+				v12 = v10;
+				v13 = 0;
+				pParty->field_75A[v12] = 0;
+				*(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
+				v14 = rand() % 258;
+				v15 = window_SpeakInHouse;
+				pParty->field_750[v12] = v14 + 1;
+				v16 = (int)((char *)v15->ptr_1C - 102);
+				if ( v16 )
+				{
+					v17 = v16 - 1;
+					if ( v17 )
+					{
+						v18 = v17 - 1;
+						if ( v18 )
+						{
+							v19 = v18 - 1;
+							if ( v19 )
+							{
+								if ( v19 == 1 )
+								{
+									while ( 1 )
+									{
+										v20 = pParty->field_750[v12];
+										if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
+										{
+											if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
+											&& ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
+											&& ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
+											&& ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
+											&& ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
+											&& ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
+											&& ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
+											&& ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
+											&& ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
+											&& ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
+											&& ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
+											&& ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
+											&& ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
+											&& ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
+											&& ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
+											&& ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
+											&& ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
+											&& ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
+												break;
+										}
+										pParty->field_750[v12] = rand() % 258 + 1;
+									}
+								}
+							}
+							else
+							{
+								while ( 1 )
+								{
+									v21 = pParty->field_750[v12];
+									if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
+									{
+									if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
+										&& ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
+										&& ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
+										&& ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
+										&& ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
+										&& ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
+										&& ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
+										&& ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
+										&& ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
+										&& ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
+										&& ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
+										&& ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
+										&& ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
+										&& ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
+											break;
+									}
+									pParty->field_750[v12] = rand() % 258 + 1;
+								}
+							}
+						}
+						else
+						{
+							while ( 1 )
+							{
+								v22 = pParty->field_750[v12];
+								if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
+								{
+									if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
+									&& ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
+									&& ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
+									&& ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
+									&& ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
+									&& ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
+									&& ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
+									&& ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
+									&& ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
+									&& ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
+									&& ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
+									break;
+								}
+								pParty->field_750[v12] = rand() % 258 + 1;
+							}
+						}
+					}
+					else
+					{
+						while ( 1 )
+						{
+							v23 = pParty->field_750[v12];
+							if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
+							{
+							if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
+								&& ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
+								&& ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
+								&& ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
+								&& ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
+								&& ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
+								&& ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
+								&& ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
+								&& ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
+								&& ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
+								&& ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
+								&& ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
+								&& ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
+								&& ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
+									break;
+							}
+							pParty->field_750[v12] = rand() % 258 + 1;
+						}
+					}
+				}
+				else
+				{
+					while ( 1 )
+					{
+						v24 = pParty->field_750[v12];
+						if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
+						{
+							if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
+							&& ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
+							&& ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
+							&& ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
+							&& ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
+							&& ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
+							&& ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
+							&& ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
+							&& ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
+							&& ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
+							&& ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
+								break;
+						}
+						pParty->field_750[v12] = rand() % 258 + 1;
+					}
+				}
+				v10 = v56;
+			}
+			v25 = v10;
+			v26 = pParty->field_750[v25];
+			v27 = pParty->field_75A[v25] == v13;
+			word_F8B1A0 = pParty->field_750[v25];
+			if ( v27 )
+			{
+				//v1 = 0;
+				v27 = v26 == v13;
+				v29 = (int)pNPCTopics[351].pText;
+				if ( v27 )
+					v29 = (int)pNPCTopics[353].pText;
+				dword_F8B1A4 = (char *)v29;
+			}
+			else
+			{
+				if ( v26 != v13 )
+				{
+					party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
+					v28 = pParty->pPlayers;
+					do
+					{
+						v28->SetVariable(VAR_Award, 86);
+						++v28;
+					}
+					while ( (signed int)v28 < (signed int)pParty->pHirelings );
+					pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
+					pParty->field_750[v25] = v13;
+					pParty->field_75A[v25] = v13;
+				}
+				//v1 = 0;
+				dword_F8B1A4 = pNPCTopics[352].pText;
+			}
+		}
+		else if ( uMessageParam == 100 )
+		{
+			pKeyActionMap->EnterText(1, 10, v8);
+		}
+		break;
+		}
+	case 22:
+		{
+		if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
+			pKeyActionMap->EnterText(1, 10, v8);
+		return;
+		break;
+		}
+	case 1:
+	case 2:
+	case 3:
+	case 4:
+	case 21:
+	case 23:
+	case 30:
+		{
+		break;
+		}
+	default:
+		{
+		return;
+		break;
+		}
+  }
+
+  /*
+  if ( in_current_building_type > BildingType_Tavern )
+  {
+    if ( in_current_building_type == BildingType_Bank )
+    {
+      if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
+        pKeyActionMap->EnterText(1, 10, v8);
+      return;
+    }
+    if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
+      return;
+  }
+  //else
+  if ( in_current_building_type < BildingType_Tavern )
+  {
+      if (in_current_building_type <= 0)
+        return;
+      if ( in_current_building_type > BildingType_AlchemistShop )
+      {
+        if ( in_current_building_type <= BildingType_16 )
+        {
+          if ( (signed __int64)__PAIR__(
+                                 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
+                                 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
+          {
+            v32 = 0;
+            do
+            {
+              //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
+				v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
+              if ( v33 )
+              {
+                v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
+                v8 = window_SpeakInHouse;
+                ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
+              }
+              ++v32;
+            }
+            while ( v32 < 12 );
+          }
+          else
+          {
+            SpellBookGenerator();
+            v30 = window_SpeakInHouse->ptr_1C;
+            v31 = pParty->uTimePlayed
+                + (signed __int64)((double)(0xA8C000
+                                          //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
+                                          * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
+                                 * 0.033333335);
+            *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
+            *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
+          }
+          return;
+        }
+        if ( in_current_building_type != BildingType_TownHall )
+          return;
+		if ( in_current_building_type == BildingType_TownHall )
+		{
+			if ( uMessageParam == 99 )
+			{
+			  v10 = (int)((char *)v8->ptr_1C - 102);
+			  v56 = v10;
+			  v11 = 8 * v10 + 11325428;
+			  if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
+			  {
+				v13 = 0;
+			  }
+			  else
+			  {
+				v12 = v10;
+				v13 = 0;
+				pParty->field_75A[v12] = 0;
+				*(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
+				v14 = rand() % 258;
+				v15 = window_SpeakInHouse;
+				pParty->field_750[v12] = v14 + 1;
+				v16 = (int)((char *)v15->ptr_1C - 102);
+				if ( v16 )
+				{
+				  v17 = v16 - 1;
+				  if ( v17 )
+				  {
+					v18 = v17 - 1;
+					if ( v18 )
+					{
+					  v19 = v18 - 1;
+					  if ( v19 )
+					  {
+						if ( v19 == 1 )
+						{
+						  while ( 1 )
+						  {
+							v20 = pParty->field_750[v12];
+							if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
+							{
+							  if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
+								&& ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
+								&& ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
+								&& ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
+								&& ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
+								&& ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
+								&& ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
+								&& ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
+								&& ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
+								&& ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
+								&& ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
+								&& ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
+								&& ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
+								&& ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
+								&& ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
+								&& ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
+								&& ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
+								&& ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
+								break;
+							}
+							pParty->field_750[v12] = rand() % 258 + 1;
+						  }
+						}
+					  }
+					  else
+					  {
+						while ( 1 )
+						{
+						  v21 = pParty->field_750[v12];
+						  if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
+						  {
+							if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
+							  && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
+							  && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
+							  && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
+							  && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
+							  && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
+							  && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
+							  && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
+							  && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
+							  && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
+							  && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
+							  && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
+							  && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
+							  && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
+							  break;
+						  }
+						  pParty->field_750[v12] = rand() % 258 + 1;
+						}
+					  }
+					}
+					else
+					{
+					  while ( 1 )
+					  {
+						v22 = pParty->field_750[v12];
+						if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
+						{
+						  if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
+							&& ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
+							&& ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
+							&& ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
+							&& ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
+							&& ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
+							&& ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
+							&& ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
+							&& ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
+							&& ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
+							&& ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
+							break;
+						}
+						pParty->field_750[v12] = rand() % 258 + 1;
+					  }
+					}
+				  }
+				  else
+				  {
+					while ( 1 )
+					{
+					  v23 = pParty->field_750[v12];
+					  if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
+					  {
+						if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
+						  && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
+						  && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
+						  && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
+						  && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
+						  && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
+						  && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
+						  && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
+						  && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
+						  && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
+						  && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
+						  && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
+						  && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
+						  && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
+						  break;
+					  }
+					  pParty->field_750[v12] = rand() % 258 + 1;
+					}
+				  }
+				}
+				else
+				{
+				  while ( 1 )
+				  {
+					v24 = pParty->field_750[v12];
+					if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
+					{
+					  if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
+						&& ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
+						&& ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
+						&& ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
+						&& ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
+						&& ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
+						&& ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
+						&& ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
+						&& ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
+						&& ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
+						&& ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
+						break;
+					}
+					pParty->field_750[v12] = rand() % 258 + 1;
+				  }
+				}
+				v10 = v56;
+			  }
+			  v25 = v10;
+			  v26 = pParty->field_750[v25];
+			  v27 = pParty->field_75A[v25] == v13;
+			  word_F8B1A0 = pParty->field_750[v25];
+			  if ( v27 )
+			  {
+				//v1 = 0;
+				v27 = v26 == v13;
+				v29 = (int)pNPCTopics[351].pText;
+				if ( v27 )
+				  v29 = (int)pNPCTopics[353].pText;
+				dword_F8B1A4 = (char *)v29;
+			  }
+			  else
+			  {
+				if ( v26 != v13 )
+				{
+				  party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
+				  v28 = pParty->pPlayers;
+				  do
+				  {
+					v28->SetVariable(VAR_Award, 86);
+					++v28;
+				  }
+				  while ( (signed int)v28 < (signed int)pParty->pHirelings );
+				  pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
+				  pParty->field_750[v25] = v13;
+				  pParty->field_75A[v25] = v13;
+				}
+				//v1 = 0;
+				dword_F8B1A4 = pNPCTopics[352].pText;
+			  }
+			}
+			else if ( uMessageParam == 100 )
+			{
+			  pKeyActionMap->EnterText(1, 10, v8);
+			}
+		}
+	  }
+  }
+  */
+  
+
+//LABEL_196:
+  switch ( uMessageParam )
+  {
+    case 96:
+		{
+        pDialogueWindow->eWindowType = WINDOW_MainMenu;
+        UI_CreateEndConversationButton();
+        FillAviableSkillsToTeach(in_current_building_type);
+        break;
+		}
+    case 101:
+		{
+        pDialogueWindow->eWindowType = WINDOW_MainMenu;
+        UI_CreateEndConversationButton();
+        sub_4B3A72(in_current_building_type);
+        break;
+		}
+    case 102:
+    case 103:
+		{
+        dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
+        break;
+		}
+    case 104:
+		{
+        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+        {
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
+          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
+          ++pMessageQueue_50CBD0->uNumMessages;
+        }*/
+        pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
+        dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
+        break;
+		}
+	case 2:
+	case 95:
+		{
+		if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
+		{
+			GenerateStandartShopItems();
+			GenerateSpecialShopItems();
+			v8 = window_SpeakInHouse;
+			v40 = window_SpeakInHouse->par1C;
+			//v3 = dword_F8B198;
+			v41 = pParty->uTimePlayed
+				//+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
+				+ (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
+									* 0.033333335);
+			pParty->field_3C.field_50[v40] = v41;
+   		}
+		v42 = v8->ptr_1C;
+		v43 = 0;
+		//v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
+		v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
+		if ( uMessageParam == 2 )
+		{
+			if ( uItemsAmountPerShopType[v44] )
+			{
+				do
+				{
+					v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
+					if ( v45 )
+					{
+						v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
+						//v3 = dword_F8B198;
+						v8 = window_SpeakInHouse;
+						ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
+					}
+					v42 = v8->ptr_1C;
+					++v43;
+				}
+				//while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+				while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+			}
+			if ( in_current_building_type == BildingType_WeaponShop )
+			{
+				v47 = v8->ptr_1C;
+				v48 = 0;
+				//if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
+				if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
+				{
+					do
+					{
+						// if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
+						if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID)
+						{
+							v49 = rand();
+							v8 = window_SpeakInHouse;
+							word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
+						}
+						v47 = v8->ptr_1C;
+						++v48;
+					}
+					//while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+					while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+				}
+			}
+		}
+		if ( uMessageParam == 95 )
+		{
+			if ( uItemsAmountPerShopType[v44] )
+			{
+				do
+				{
+					//v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
+					v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
+					if ( v50 )
+					{
+						v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
+						//v3 = dword_F8B198;
+						v8 = window_SpeakInHouse;
+						ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
+					}
+					v42 = v8->ptr_1C;
+					++v43;
+				}
+				//while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+				while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+			}
+			if ( in_current_building_type == BildingType_WeaponShop )
+			{
+				v52 = v8->ptr_1C;
+				v53 = 0;
+				//if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
+				if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
+				{
+					do
+					{
+						// if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
+						if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
+						{
+							v54 = rand();
+							v8 = window_SpeakInHouse;
+							word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
+						}
+						v52 = v8->ptr_1C;
+						++v53;
+					}
+					//while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+					while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
+				}
+			}
+		}
+		break;
+		}
+	case 3:
+	case 4:
+	case 5:
+		{
+		dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
+		sub_421B2C_PlaceInInventory_or_DropPickedItem();
+		break;
+		}
+	case 94:
+		{
+        pDialogueWindow->eWindowType = WINDOW_MainMenu;
+        UI_CreateEndConversationButton();
+        sub_4B3AD4(in_current_building_type);
+		break;
+		}
+	default:
+		{
+		if( uMessageParam >= 36 && uMessageParam <= 72 )
+		{
+			v35 = pPlayers[uActiveCharacter];
+			//v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
+			v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
+			v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
+			if ( v37 < v36 / 3 )
+			v37 = v36 / 3;
+              
+			__debugbreak();
+			//pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
+			// or
+			//byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
+			// or
+			//byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
+
+			//if (false)
+			if(byte_4ED970_skill_learn_ability_by_class_table[v35->classType][uMessageParam-36])
+			//if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
+			{
+			v38 = (int)(&v35->uIntelligence + uMessageParam);
+			if ( !*(short *)v38 )
+			{
+				if ( pParty->uNumGold < v37 )
+				{
+				ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
+				if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
+					v39 = 4;
+				else
+					v39 = 2;
+				PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
+				}
+				else
+				{
+				Party::TakeGold(v37);
+				dword_F8B1E4 = 1;
+				*(short *)v38 = 1;
+				v35->PlaySound(SPEECH_78, 0);
+				}
+			}
+			}
+		}
+		break;
+		}
+  }
+  /*
+  if ( uMessageParam != 95 && uMessageParam != 2 )
+  {
+    if ( uMessageParam == 3 )
+    {
+      dialog_menu_id = 3;
+    }
+    else
+    {
+      if ( uMessageParam == 4 )
+      {
+        dialog_menu_id = 4;
+      }
+      else
+      {
+        if ( uMessageParam != 5 )
+        {
+          if ( uMessageParam > 35 )
+          {
+            if ( uMessageParam <= 72 )
+            {
+              v35 = pPlayers[uActiveCharacter];
+              //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
+              v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
+              v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
+              if ( v37 < v36 / 3 )
+                v37 = v36 / 3;
+              
+              __debugbreak();
+              //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
+              // or
+              //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
+              // or
+              //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
+
+              if (false)
+              //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
+              {
+                v38 = (int)(&v35->uIntelligence + uMessageParam);
+                if ( !*(short *)v38 )
+                {
+                  if ( pParty->uNumGold < v37 )
+                  {
+                    ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
+                    if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
+                      v39 = 4;
+                    else
+                      v39 = 2;
+                    PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
+                  }
+                  else
+                  {
+                    Party::TakeGold(v37);
+                    dword_F8B1E4 = 1;
+                    *(short *)v38 = 1;
+                    v35->PlaySound(SPEECH_78, 0);
+                  }
+                }
+              }
+            }
+            else
+            {
+              if ( uMessageParam == 94 )
+              {
+                pDialogueWindow->eWindowType = WINDOW_MainMenu;
+                UI_CreateEndConversationButton();
+                sub_4B3AD4(in_current_building_type);
+              }
+            }
+          }
+          return;
+        }
+        dialog_menu_id = 5;
+      }
+    }
+    sub_421B2C_PlaceInInventory_or_DropPickedItem();
+    return;
+  }
+  if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
+  {
+    GenerateStandartShopItems();
+    GenerateSpecialShopItems();
+    v8 = window_SpeakInHouse;
+    v40 = window_SpeakInHouse->par1C;
+    //v3 = dword_F8B198;
+    v41 = pParty->uTimePlayed
+        //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
+        + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
+                         * 0.033333335);
+    pParty->field_3C.field_50[v40] = v41;
+   
+  }
+  v42 = v8->ptr_1C;
+  v43 = 0;
+  //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
+  v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
+  if ( uMessageParam == 2 )
+  {
+    if ( uItemsAmountPerShopType[v44] )
+    {
+      do
+      {
+        v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
+        if ( v45 )
+        {
+          v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
+          //v3 = dword_F8B198;
+          v8 = window_SpeakInHouse;
+          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
+        }
+        v42 = v8->ptr_1C;
+        ++v43;
+      }
+      //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+      while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+    }
+    if ( in_current_building_type == BildingType_WeaponShop )
+    {
+      v47 = v8->ptr_1C;
+      v48 = 0;
+      //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
+      if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
+      {
+        do
+        {
+         // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
+		 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
+          {
+            v49 = rand();
+            v8 = window_SpeakInHouse;
+            word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
+          }
+          v47 = v8->ptr_1C;
+          ++v48;
+        }
+        //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+        while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+      }
+    }
+  }
+  if ( uMessageParam == 95 )
+  {
+    if ( uItemsAmountPerShopType[v44] )
+    {
+      do
+      {
+        //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
+	  v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
+        if ( v50 )
+        {
+          v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
+          //v3 = dword_F8B198;
+          v8 = window_SpeakInHouse;
+          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
+        }
+        v42 = v8->ptr_1C;
+        ++v43;
+      }
+      //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+      while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
+    }
+    if ( in_current_building_type == BildingType_WeaponShop )
+    {
+      v52 = v8->ptr_1C;
+      v53 = 0;
+      //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
+      if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
+      {
+        do
+        {
+         // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
+		if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
+          {
+            v54 = rand();
+            v8 = window_SpeakInHouse;
+            word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
+          }
+          v52 = v8->ptr_1C;
+          ++v53;
+        }
+        //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
+        while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
+      }
+    }
+  }
+*/
+}
+
+
+
+//----- (004B6943) --------------------------------------------------------
+void __cdecl TravelByTransport()
+{
+  GUIWindow *v0; // ebx@1
+  Player *v1; // esi@1
+  signed int v2; // edi@1
+  unsigned int v3; // eax@1
+  signed int v4; // ebx@1
+  stru365_travel_info *v5; // esi@7
+  //int v6; // eax@9
+  //int v7; // eax@9
+  //int v8; // eax@12
+  //int v9; // edi@12
+  //int v10; // edx@12
+  int v11; // ecx@12
+  signed int v12; // esi@13
+  signed int v13; // edi@14
+  DWORD v14; // eax@26
+  DWORD v15; // edi@26
+  GUIWindow *v16; // ebx@36
+  int v17; // esi@36
+  int v18; // eax@36
+  int v19; // ecx@36
+  int v20; // esi@36
+  int v21; // eax@36
+  void *v22; // eax@39
+  int v23; // esi@39
+  GUIButton *v24; // ebx@39
+  signed int v25; // eax@41
+  //int v26; // esi@44
+  //const char *v27; // eax@46
+  char *v28; // eax@62
+  int v29; // eax@62
+  unsigned int v30; // ecx@62
+  char *v31; // eax@63
+  MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
+  /*int v33; // [sp-38h] [bp-2C8h]@62
+  int v34; // [sp-34h] [bp-2C4h]@62
+  int v35; // [sp-30h] [bp-2C0h]@62
+  int v36; // [sp-2Ch] [bp-2BCh]@62
+  int v37; // [sp-28h] [bp-2B8h]@62
+  int v38; // [sp-24h] [bp-2B4h]@62
+  int v39; // [sp-20h] [bp-2B0h]@62
+  int v40; // [sp-1Ch] [bp-2ACh]@62
+  int v41; // [sp-18h] [bp-2A8h]@62
+  int v42; // [sp-14h] [bp-2A4h]@62
+  char *v43; // [sp-10h] [bp-2A0h]@62
+  char *v44; // [sp-Ch] [bp-29Ch]@62
+  unsigned int v45; // [sp-8h] [bp-298h]@62
+  char *v46; // [sp-4h] [bp-294h]@62
+  const char *v47[5]; // [sp+0h] [bp-290h]@7*/
+  char v48[5][100]; // [sp+14h] [bp-27Ch]@37
+  //char v49[100]; // [sp+78h] [bp-218h]@68
+  //char v50[100]; // [sp+DCh] [bp-1B4h]@68
+  //char v51[100]; // [sp+140h] [bp-150h]@68
+  //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
+  GUIWindow v53; // [sp+208h] [bp-88h]@1
+  int v54; // [sp+25Ch] [bp-34h]@36
+  int v55; // [sp+260h] [bp-30h]@36
+  //unsigned int v56; // [sp+264h] [bp-2Ch]@1
+  //int v57; // [sp+268h] [bp-28h]@1
+  int v58; // [sp+26Ch] [bp-24h]@36
+  //GUIWindow *v59; // [sp+270h] [bp-20h]@1
+  unsigned int v60; // [sp+274h] [bp-1Ch]@36
+  //Player *v61; // [sp+278h] [bp-18h]@1
+  int v62; // [sp+27Ch] [bp-14h]@36
+  int v63; // [sp+280h] [bp-10h]@14
+  char *a1; // [sp+284h] [bp-Ch]@37
+  unsigned int s1; // [sp+288h] [bp-8h]@1
+  int v66; // [sp+28Ch] [bp-4h]@48
+
+  v0 = window_SpeakInHouse;
+  memcpy(&v53, window_SpeakInHouse, sizeof(v53));
+  v2 = 255;
+  //v61 = pPlayers[uActiveCharacter];
+  v1 = pPlayers[uActiveCharacter];
+  v53.uFrameX = 483;
+  v53.uFrameWidth = 148;
+  v53.uFrameZ = 334;
+  auto color_default = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255);
+  auto color_selected = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 155);
+  v3 = 52 * (unsigned int)v0->ptr_1C;
+  //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
+  //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
+  //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
+
+  v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
+  v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
+
+  s1 = v4 * (100 - v1->GetMerchant()) / 100;
+  if ( (signed int)s1 < v4 / 3 )
+    s1 = v4 / 3;
+  if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
+  {
+    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    {
+      v16 = pDialogueWindow;
+      v58 = 255;
+      v62 = 0;
+      v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
+      //v59 = pDialogueWindow;
+      v54 = v17;
+      strcpy(v48[4], "");
+      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
+      v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
+      v19 = v16->pNumPresenceButton;
+      v20 = v18 + v17 + 146;
+      v21 = v16->pStartingPosActiveItem;
+      v63 = v20;
+      v55 = v20;
+      v60 = v21;
+      if ( v21 >= v21 + v19 )
+        goto LABEL_71;
+      s1 = 2;
+      a1 = (char *)v48;
+      while ( 1 )
+      {
+        int v47 = v60;
+        v22 = window_SpeakInHouse->ptr_1C;
+        v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
+        //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
+        //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
+        v24 = v16->GetControl(v60);
+
+        if (v23 != v58)
+        {
+          if (v23 >= 25)
+            Log::Warning(L"Transport UI: scedule overflow");
+          if (s1 >= 6)
+            v25 = true;
+          else
+            v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
+        }
+
+        if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
+        {
+            v58 = v23;
+            if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
+              sprintf(a1, "\f%05d", color_selected);
+            else
+              sprintf(a1, "\f%05d", color_default);
+
+          //v32.uRedbookTrackID = v27;
+          v66 = transport_schedule[v23].uTravelTime;
+          if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
+          {
+            if ( CheckHiredNPCSpeciality(Sailor) )
+              v66 -= 2;
+            if ( CheckHiredNPCSpeciality(Navigator) )
+              v66 -= 3;
+            if ( CheckHiredNPCSpeciality(Pirate) )
+              v66 -= 2;
+          }
+          else
+          {
+            if ( CheckHiredNPCSpeciality(Horseman) )
+              v66 -= 2;
+          }
+          if ( CheckHiredNPCSpeciality(Explorer) )
+            --v66;
+          if ( v66 < 1 )
+            v66 = 1;
+          if ( v23 != v2 )
+          {
+            memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
+            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
+                      v66, v32.pName);
+            strcat(a1, pTmpBuf);
+            v28 = a1;
+            a1 += 100;
+            ++v62;
+            ++s1;
+            strcat(v28, "\n \n");
+            v24->uY = v63;
+            v29 = pFontArrus->CalcTextHeight(pTmpBuf, &v53, 0, 0);
+            v30 = v24->uY;
+            v24->uHeight = v29;
+            v2 = 255;
+            v24->uW = v30 + v29 - 1;
+            v63 += v54 + v29;
+          }
+        }
+        else
+        {
+          v31 = a1;
+          ++v62;
+          ++s1;
+          a1 += 100;
+          strcpy(v31, "");
+          if ( v24 )
+          {
+            v24->uW = 0;
+            v24->uHeight = 0;
+            v24->uY = 0;
+          }
+        }
+        ++v60;
+        if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
+          break;
+        //v16 = v59;
+      }
+      if ( v63 != v55 )
+      {
+        /*v47[1] = &Dest;
+        v47[0] = &v51;
+        v46 = &v50;
+        v45 = (unsigned int)&v49;
+        v44 = &v48;
+        v43 = pTmpBuf2;*/
+        sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48[0], v48[1], v48[2], v48[3], v48[4]);
+        v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+      }
+      else
+      {
+LABEL_71:
+        v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
+                          color_default, pGlobalTXT_LocalizationStrings[561], 3);
+        pAudioPlayer->StopChannels(-1, -1);
+      }
+    }
+  }
+  else
+  {
+    if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
+    {
+      if ( pParty->uNumGold < s1 )
+      {
+        ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
+        PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
+        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
+        return;
+      }
+
+      Party::TakeGold(s1);
+
+      v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
+      if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
+      {
+        if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) )
+        {
+          SaveGame(1, 0);
+          strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename);
+
+          dword_6BE364_game_settings_1 |= 1u;
+          _5B65B8_npcdata_hiword_house_or_other = 0;
+          dword_5B65BC = 0;
+          _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
+          v11 = *((int *)v5 + 3);
+          uGameState = 2;
+          _5B65A8_npcdata_uflags_or_other = v11;
+          _5B65AC_npcdata_fame_or_other = v5->arrival_y;
+          _5B65B0_npcdata_rep_or_other = v5->arrival_z;
+          dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
+        }
+        else
+        {
+          pIndoorCamera->sRotationY = 0;
+          pParty->uFlags |= 2u;
+          pParty->vPosition.x = v5->arrival_x;
+          pParty->vPosition.y = v5->arrival_y;
+          pParty->vPosition.z = v5->arrival_z;
+          pParty->uFallStartY = pParty->vPosition.z;
+          pParty->sRotationX = 0;
+          pParty->sRotationY = v5->arrival_rot_y;
+        }
+        PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
+        v12 = v5->uTravelTime;
+        int _v47;
+        if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
+        {
+          v63 = SPEECH_SetSail;
+          v13 = 2500;
+          if ( CheckHiredNPCSpeciality(Sailor) )
+            v12 -= 2;
+          if ( CheckHiredNPCSpeciality(Navigator) )
+            v12 -= 3;
+          //_v47 = 45;
+          if ( CheckHiredNPCSpeciality(Pirate) )
+            v12 -= 2;
+        }
+        else
+        {
+          v63 = SPEECH_CarriageReady;
+          v13 = 1500;
+          //_v47 = 35;
+          if ( CheckHiredNPCSpeciality(Horseman) )
+            v12 -= 2;
+        }
+        if ( CheckHiredNPCSpeciality(Explorer) )
+          --v12;
+        if ( v12 < 1 )
+          v12 = 1;
+        RestAndHeal(1440 * v12);
+        v1->PlaySound((PlayerSpeech)v63, 0);
+        v14 = GetTickCount();
+        v15 = v14 + v13;
+        if ( v15 < v14 )
+          v15 = v14;
+        while ( GetTickCount() < v15 )
+          sqrt(3.1415926);
+        while ( sub_4BD8B5() )
+          ;
+        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
+        return;
+      }
+      else
+      {
+        dialog_menu_id = HOUSE_DIALOGUE_MAIN;
+        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+      }
+    }
+  }
+}
+
+
+
+
+
+
 //----- (004B68EA) --------------------------------------------------------
 bool __fastcall IsTravelAvailable(int a1)
 {
-  //signed int v1; // edi@1
-  //int *v2; // esi@1
-  //int v3; // ecx@2
-
-  __debugbreak(); // fill all 25 elements of array_4F09B0 before continue
-  //v1 = 0;
-  //v2 = &dword_4F0E10[a1];
-  //while ( 1 )
   for (uint i = 0; i < 4; ++i)
   {
-    uint idx = byte_4F0E10[a1][i];
-    //v3 = 8 * byte_4F0E10[a1][i];
-    if (travel_schedule[idx].pSchedule[pParty->uDaysPlayed % 7])
+    uint route = transport_routes[a1][i];
+    if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
     {
-      if (!travel_schedule[idx].uQuestBit || _449B57_test_bit(pParty->_quest_bits, travel_schedule[idx].uQuestBit))
+      if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
         return true;
     }
-    //++v1;
-    //if ( v1 >= 4 )
-    //  return 0;
   }
   return false;
-  //return 1;
 }
 
 
--- a/UIHouses.h	Sun Mar 24 09:18:51 2013 +0600
+++ b/UIHouses.h	Sun Mar 24 09:19:36 2013 +0600
@@ -37,9 +37,10 @@
   HOUSE_DIALOGUE_TAVERN_ARCOMAGE_102 = 102,
   HOUSE_DIALOGUE_TAVERN_ARCOMAGE_103 = 103,
   HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT = 104,
-
-  HOUSE_DIALOGUE_108 = 108,
-
+  HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 = 105,
+  HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_2 = 106,
+  HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_3 = 107,
+  HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 = 108,
   HOUSE_DIALOGUE_OTHER = -1
 };
 
@@ -53,6 +54,25 @@
   HOUSE_ALCHEMIST_EMERALD_ISLE = 42,
   HOUSE_ALCHEMIST_HARMONDALE = 43,
   HOUSE_STABLES_HARMONDALE = 54,
+  HOUSE_STABLES_STEADWICK = 55,
+  HOUSE_STABLES_56 = 56,
+  HOUSE_STABLES_57 = 57,
+  HOUSE_STABLES_58 = 58,
+  HOUSE_STABLES_59 = 59,
+  HOUSE_STABLES_60 = 60,
+  HOUSE_STABLES_61 = 61,
+  HOUSE_STABLES_62 = 62,
+  HOUSE_BOATS_63 = 63,
+  HOUSE_BOATS_64 = 64,
+  HOUSE_BOATS_65 = 65,
+  HOUSE_BOATS_66 = 66,
+  HOUSE_BOATS_67 = 67,
+  HOUSE_BOATS_68 = 68,
+  HOUSE_BOATS_69 = 69,
+  HOUSE_BOATS_70 = 70,
+  HOUSE_BOATS_71 = 71,
+  HOUSE_BOATS_72 = 72,
+  HOUSE_BOATS_73 = 73,
   HOUSE_TEMPLE_EMERALD_ISLE = 74,
   HOUSE_TEMPLE_HARMONDALE = 75,
   HOUSE_TRAINING_HALL_EMERALD_ISLE = 89,
@@ -77,6 +97,7 @@
   HOUSE_JUDGE_HARMONDALE = 190,
   HOUSE_224_EMERALD_ISLE = 224,
   HOUSE_225_EMERALD_ISLE = 225,
+  HOUSE_238_EMERALD_ISLE = 238,
   HOUSE_466_HARMONDALE = 466,
   HOUSE_467_HARMONDALE = 467,
   HOUSE_468_HARMONDALE = 468,
--- a/mm7_1.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_1.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -8,7 +8,6 @@
 #include <assert.h>
 
 #include "MM7.h"
-
 #include "MapInfo.h"
 #include "Game.h"
 #include "GUIWindow.h"
@@ -52,24 +51,13 @@
 #include "texts.h"
 #include "stru351.h"
 #include "UIHouses.h"
-
 #include "mm7_data.h"
 
-
-
-
 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive);
 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine);
 
-
-
-
-
-
-
-
 //----- (004453C0) mm6-----------------------------------------------------
 //----- (004A1760) mm6_chinese---------------------------------------------
 int fixpoint_mul(int a1, int a2)
@@ -113,8 +101,6 @@
 // 506988: using guessed type int dword_506988;
 // 50698C: using guessed type int dword_50698C;
 // 507CC0: using guessed type int dword_507CC0;
-
-
 // 50651C: using guessed type int dword_50651C;
 // 506520: using guessed type int dword_506520;
 // 506524: using guessed type int dword_506524;
@@ -123,14 +109,8 @@
 // 506548: using guessed type int dword_506548;
 // 723E80: using guessed type int dword_723E80_award_related[];
 // 723E84: using guessed type int dword_723E84[];
-
-
-
 // 5075E0: using guessed type int pVisibleWindowsIdxs[20];
 
-
-
-
 //----- (0041CD4F) --------------------------------------------------------
 bool __thiscall sub_41CD4F(unsigned int _this)
 {
@@ -480,12 +460,6 @@
   return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0);
 }
 
-
-
-
-
-
-
 //----- (0041F54A) --------------------------------------------------------
 void __cdecl LoadActualSkyFrame()
 {
@@ -544,9 +518,6 @@
   viewparams->bRedrawGameUI = 1;
 }
 
-
-
-
 //----- (0042038D) --------------------------------------------------------
 void __cdecl sub_42038D()
 {
@@ -574,7 +545,6 @@
   }
 }
 
-
 //----- (00420C05) --------------------------------------------------------
 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
 {
@@ -731,8 +701,6 @@
   }
 }
 
-
-
 //----- (004219BE) --------------------------------------------------------
 GUIWindow *stru277::sub_4219BE()
 {
@@ -770,7 +738,6 @@
   return v2;
 }
 
-
 //----- (00421B2C) --------------------------------------------------------
 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem()
 {
@@ -866,7 +833,6 @@
   return 1;
 }
 
-
 //----- (00421D00) --------------------------------------------------------
 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID)
 {
@@ -1635,8 +1601,6 @@
   uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6);
 }
 
-
-
 //----- (00423AEE) --------------------------------------------------------
 void __cdecl reset_some_strus_flt_2Cs()
 {
@@ -2458,7 +2422,6 @@
   return result;*/
 }
 
-
 //----- (00424829) --------------------------------------------------------
 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4)
 {
--- a/mm7_2.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_2.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -53,12 +53,9 @@
 #include "Log.h"
 #include "UIHouses.h"
 #include "texts.h"
-
 #include "mm7_data.h"
 #include "MM7.h"
 
-
-
 //----- (004BB756) --------------------------------------------------------
 signed int __fastcall sub_4BB756(signed int a1)
 {
@@ -744,10 +741,6 @@
   pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
 }
 
-
-
-
-
 //----- (004BC8D5) --------------------------------------------------------
 void SpellBookGenerator()
 	{
@@ -810,7 +803,6 @@
   return;
 }
 
-
 //----- (004BCA33) --------------------------------------------------------
 void UI_CreateEndConversationButton()
 {
@@ -822,1085 +814,6 @@
   pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, 0x51u, 0, 0, "", 0);
 }
 
-//----- (004BCACC) --------------------------------------------------------
-void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
-{
-  //unsigned int v1; // edi@1
-  //signed int v2; // ebx@1
-  //signed int v3; // ecx@2
-  int v4; // eax@5
-  signed int v5; // esi@5
-  //Player *v6; // ecx@5
-  //signed int v7; // edx@5
-  GUIWindow *v8; // esi@10
-  unsigned int v9; // eax@12
-  int v10; // esi@31
-  int v11; // edi@31
-  int v12; // esi@32
-  __int16 v13; // bp@32
-  int v14; // edx@32
-  GUIWindow *v15; // eax@32
-  int v16; // eax@32
-  int v17; // eax@33
-  int v18; // eax@34
-  int v19; // eax@35
-  __int16 v20; // ax@37
-  __int16 v21; // ax@76
-  __int16 v22; // ax@107
-  __int16 v23; // ax@132
-  __int16 v24; // ax@163
-  int v25; // esi@190
-  __int16 v26; // ax@190
-  char v27; // zf@190
-  Player *v28; // edi@192
-  int v29; // eax@204
-  void *v30; // esi@208
-  unsigned __int64 v31; // qax@208
-  signed int v32; // edi@209
-  int v33; // eax@210
-  unsigned int v34; // eax@211
-  Player *v35; // edi@227
-  signed int v36; // esi@227
-  int v37; // ecx@227
-  int v38; // esi@230
-  int v39; // edx@235
-  int v40; // edi@243
-  unsigned __int64 v41; // qax@243
-  void *v42; // eax@244
-  signed int v43; // edi@244
-  int v44; // edx@244
-  int v45; // eax@246
-  unsigned int v46; // eax@247
-  void *v47; // eax@250
-  signed int v48; // edi@250
-  int v49; // eax@252
-  int v50; // eax@256
-  unsigned int v51; // eax@257
-  void *v52; // eax@260
-  signed int v53; // edi@260
-  int v54; // eax@262
-  //signed int v55; // [sp+10h] [bp-10h]@1
-  int v56; // [sp+14h] [bp-Ch]@31
-
-  //v1 = 0;
-  //v2 = a1;
-  //v55 = a1;
-  if ( !pDialogueWindow->pNumPresenceButton )
-    return;
-  pRenderer->ClearZBuffer(0, 479);
-  //v3 = dword_F8B198;
-  if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
-  {
-	v8 = window_SpeakInHouse;
-  }
-  //else
-  if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
-  {
-	  if ( in_current_building_type == BildingType_Training )
-	  {
-		if ( uMessageParam == 17 )
-		{
-		  v4 = 0;
-		  v5 = 0;
-		  //v6 = pPlayers[uActiveCharacter];
-		  //v7 = pPlayers[uActiveCharacter]->uLevel;
-		  if ( pPlayers[uActiveCharacter]->uLevel > 0 )
-		  {
-			do
-			  v4 += v5++ + 1;
-			while ( v5 < pPlayers[uActiveCharacter]->uLevel );
-		  }
-		  if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
-			  (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
-			return;
-		}
-		pDialogueWindow->Release();
-		pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
-		pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
-					                                    pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
-		pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr);
-//	LABEL_10:
-		//v3 = dword_F8B198;
-		v8 = window_SpeakInHouse;
-	  }
-	  //else
-	  if ( in_current_building_type != BildingType_Training )
-	  {
-		  v8 = window_SpeakInHouse;
-		  if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
-			  travel_schedule[byte_4F0CD0[(unsigned int)window_SpeakInHouse->ptr_1C - 1][uMessageParam - 1]].pSchedule[pParty->uDaysPlayed % 7]
-			|| in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
-		  {
-		//LABEL_9:
-			pDialogueWindow->Release();
-			pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
-			pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
-						                                    pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
-			pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", nullptr);
-	//	LABEL_10:
-			//v3 = dword_F8B198;
-			v8 = window_SpeakInHouse;
-		  }
-		  else if (uActiveCharacter)
-		  {
-			if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
-			  return;
-			v8 = window_SpeakInHouse;
-		  }
-	  }
-	//LABEL_11:
-	  dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
-	  if ( in_current_building_type < BildingType_19 )
-	  {
-		v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
-		//v3 = dword_F8B198;
-		ShopTexture = &pIcons_LOD->pTextures[v9];
-	//LABEL_13:
-		v8 = window_SpeakInHouse;
-	  }
-  }
-  
-  //NEW
-  switch(in_current_building_type)
-  {
-	case 5:
-	case 6:
-	case 7:
-	case 8:
-	case 9:
-	case 10:
-	case 11:
-	case 12:
-	case 13:
-	case 14:
-	case 15:
-	case 16:
-		{
-        if ( (signed __int64)__PAIR__(
-                                *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
-                                *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
-        {
-			v32 = 0;
-			do
-			{
-				//v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
-				v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
-				if ( v33 )
-				{
-				v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
-				v8 = window_SpeakInHouse;
-				ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
-				}
-				++v32;
-			}
-			while ( v32 < 12 );
-        }
-        else
-        {
-			SpellBookGenerator();
-			v30 = window_SpeakInHouse->ptr_1C;
-			v31 = pParty->uTimePlayed
-				+ (signed __int64)((double)(0xA8C000
-											//* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
-											* (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
-									* 0.033333335);
-			*(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
-			*(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
-        }
-        return;
-		break;
-		}
-	case 17:
-		{
-		if ( uMessageParam == 99 )
-		{
-			v10 = (int)((char *)v8->ptr_1C - 102);
-			v56 = v10;
-			v11 = 8 * v10 + 11325428;
-			if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
-			{
-				v13 = 0;
-			}
-			else
-			{
-				v12 = v10;
-				v13 = 0;
-				pParty->field_75A[v12] = 0;
-				*(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
-				v14 = rand() % 258;
-				v15 = window_SpeakInHouse;
-				pParty->field_750[v12] = v14 + 1;
-				v16 = (int)((char *)v15->ptr_1C - 102);
-				if ( v16 )
-				{
-					v17 = v16 - 1;
-					if ( v17 )
-					{
-						v18 = v17 - 1;
-						if ( v18 )
-						{
-							v19 = v18 - 1;
-							if ( v19 )
-							{
-								if ( v19 == 1 )
-								{
-									while ( 1 )
-									{
-										v20 = pParty->field_750[v12];
-										if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
-										{
-											if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
-											&& ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
-											&& ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
-											&& ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
-											&& ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
-											&& ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
-											&& ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
-											&& ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
-											&& ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
-											&& ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
-											&& ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
-											&& ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
-											&& ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
-											&& ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
-											&& ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
-											&& ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
-											&& ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
-											&& ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
-												break;
-										}
-										pParty->field_750[v12] = rand() % 258 + 1;
-									}
-								}
-							}
-							else
-							{
-								while ( 1 )
-								{
-									v21 = pParty->field_750[v12];
-									if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
-									{
-									if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
-										&& ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
-										&& ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
-										&& ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
-										&& ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
-										&& ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
-										&& ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
-										&& ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
-										&& ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
-										&& ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
-										&& ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
-										&& ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
-										&& ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
-										&& ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
-											break;
-									}
-									pParty->field_750[v12] = rand() % 258 + 1;
-								}
-							}
-						}
-						else
-						{
-							while ( 1 )
-							{
-								v22 = pParty->field_750[v12];
-								if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
-								{
-									if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
-									&& ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
-									&& ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
-									&& ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
-									&& ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
-									&& ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
-									&& ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
-									&& ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
-									&& ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
-									&& ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
-									&& ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
-									break;
-								}
-								pParty->field_750[v12] = rand() % 258 + 1;
-							}
-						}
-					}
-					else
-					{
-						while ( 1 )
-						{
-							v23 = pParty->field_750[v12];
-							if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
-							{
-							if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
-								&& ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
-								&& ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
-								&& ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
-								&& ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
-								&& ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
-								&& ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
-								&& ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
-								&& ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
-								&& ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
-								&& ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
-								&& ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
-								&& ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
-								&& ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
-									break;
-							}
-							pParty->field_750[v12] = rand() % 258 + 1;
-						}
-					}
-				}
-				else
-				{
-					while ( 1 )
-					{
-						v24 = pParty->field_750[v12];
-						if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
-						{
-							if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
-							&& ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
-							&& ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
-							&& ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
-							&& ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
-							&& ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
-							&& ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
-							&& ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
-							&& ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
-							&& ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
-							&& ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
-								break;
-						}
-						pParty->field_750[v12] = rand() % 258 + 1;
-					}
-				}
-				v10 = v56;
-			}
-			v25 = v10;
-			v26 = pParty->field_750[v25];
-			v27 = pParty->field_75A[v25] == v13;
-			word_F8B1A0 = pParty->field_750[v25];
-			if ( v27 )
-			{
-				//v1 = 0;
-				v27 = v26 == v13;
-				v29 = (int)pNPCTopics[351].pText;
-				if ( v27 )
-					v29 = (int)pNPCTopics[353].pText;
-				dword_F8B1A4 = (char *)v29;
-			}
-			else
-			{
-				if ( v26 != v13 )
-				{
-					party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
-					v28 = pParty->pPlayers;
-					do
-					{
-						v28->SetVariable(VAR_Award, 86);
-						++v28;
-					}
-					while ( (signed int)v28 < (signed int)pParty->pHirelings );
-					pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
-					pParty->field_750[v25] = v13;
-					pParty->field_75A[v25] = v13;
-				}
-				//v1 = 0;
-				dword_F8B1A4 = pNPCTopics[352].pText;
-			}
-		}
-		else if ( uMessageParam == 100 )
-		{
-			pKeyActionMap->EnterText(1, 10, v8);
-		}
-		break;
-		}
-	case 22:
-		{
-		if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
-			pKeyActionMap->EnterText(1, 10, v8);
-		return;
-		break;
-		}
-	case 1:
-	case 2:
-	case 3:
-	case 4:
-	case 21:
-	case 23:
-	case 30:
-		{
-		break;
-		}
-	default:
-		{
-		return;
-		break;
-		}
-  }
-
-  /*
-  if ( in_current_building_type > BildingType_Tavern )
-  {
-    if ( in_current_building_type == BildingType_Bank )
-    {
-      if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
-        pKeyActionMap->EnterText(1, 10, v8);
-      return;
-    }
-    if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
-      return;
-  }
-  //else
-  if ( in_current_building_type < BildingType_Tavern )
-  {
-      if (in_current_building_type <= 0)
-        return;
-      if ( in_current_building_type > BildingType_AlchemistShop )
-      {
-        if ( in_current_building_type <= BildingType_16 )
-        {
-          if ( (signed __int64)__PAIR__(
-                                 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
-                                 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
-          {
-            v32 = 0;
-            do
-            {
-              //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
-				v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
-              if ( v33 )
-              {
-                v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
-                v8 = window_SpeakInHouse;
-                ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
-              }
-              ++v32;
-            }
-            while ( v32 < 12 );
-          }
-          else
-          {
-            SpellBookGenerator();
-            v30 = window_SpeakInHouse->ptr_1C;
-            v31 = pParty->uTimePlayed
-                + (signed __int64)((double)(0xA8C000
-                                          //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
-                                          * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
-                                 * 0.033333335);
-            *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
-            *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
-          }
-          return;
-        }
-        if ( in_current_building_type != BildingType_TownHall )
-          return;
-		if ( in_current_building_type == BildingType_TownHall )
-		{
-			if ( uMessageParam == 99 )
-			{
-			  v10 = (int)((char *)v8->ptr_1C - 102);
-			  v56 = v10;
-			  v11 = 8 * v10 + 11325428;
-			  if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
-			  {
-				v13 = 0;
-			  }
-			  else
-			  {
-				v12 = v10;
-				v13 = 0;
-				pParty->field_75A[v12] = 0;
-				*(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
-				v14 = rand() % 258;
-				v15 = window_SpeakInHouse;
-				pParty->field_750[v12] = v14 + 1;
-				v16 = (int)((char *)v15->ptr_1C - 102);
-				if ( v16 )
-				{
-				  v17 = v16 - 1;
-				  if ( v17 )
-				  {
-					v18 = v17 - 1;
-					if ( v18 )
-					{
-					  v19 = v18 - 1;
-					  if ( v19 )
-					  {
-						if ( v19 == 1 )
-						{
-						  while ( 1 )
-						  {
-							v20 = pParty->field_750[v12];
-							if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
-							{
-							  if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
-								&& ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
-								&& ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
-								&& ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
-								&& ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
-								&& ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
-								&& ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
-								&& ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
-								&& ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
-								&& ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
-								&& ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
-								&& ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
-								&& ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
-								&& ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
-								&& ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
-								&& ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
-								&& ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
-								&& ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
-								break;
-							}
-							pParty->field_750[v12] = rand() % 258 + 1;
-						  }
-						}
-					  }
-					  else
-					  {
-						while ( 1 )
-						{
-						  v21 = pParty->field_750[v12];
-						  if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
-						  {
-							if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
-							  && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
-							  && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
-							  && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
-							  && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
-							  && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
-							  && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
-							  && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
-							  && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
-							  && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
-							  && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
-							  && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
-							  && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
-							  && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
-							  break;
-						  }
-						  pParty->field_750[v12] = rand() % 258 + 1;
-						}
-					  }
-					}
-					else
-					{
-					  while ( 1 )
-					  {
-						v22 = pParty->field_750[v12];
-						if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
-						{
-						  if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
-							&& ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
-							&& ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
-							&& ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
-							&& ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
-							&& ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
-							&& ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
-							&& ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
-							&& ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
-							&& ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
-							&& ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
-							break;
-						}
-						pParty->field_750[v12] = rand() % 258 + 1;
-					  }
-					}
-				  }
-				  else
-				  {
-					while ( 1 )
-					{
-					  v23 = pParty->field_750[v12];
-					  if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
-					  {
-						if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
-						  && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
-						  && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
-						  && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
-						  && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
-						  && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
-						  && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
-						  && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
-						  && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
-						  && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
-						  && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
-						  && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
-						  && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
-						  && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
-						  break;
-					  }
-					  pParty->field_750[v12] = rand() % 258 + 1;
-					}
-				  }
-				}
-				else
-				{
-				  while ( 1 )
-				  {
-					v24 = pParty->field_750[v12];
-					if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
-					{
-					  if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
-						&& ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
-						&& ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
-						&& ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
-						&& ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
-						&& ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
-						&& ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
-						&& ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
-						&& ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
-						&& ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
-						&& ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
-						break;
-					}
-					pParty->field_750[v12] = rand() % 258 + 1;
-				  }
-				}
-				v10 = v56;
-			  }
-			  v25 = v10;
-			  v26 = pParty->field_750[v25];
-			  v27 = pParty->field_75A[v25] == v13;
-			  word_F8B1A0 = pParty->field_750[v25];
-			  if ( v27 )
-			  {
-				//v1 = 0;
-				v27 = v26 == v13;
-				v29 = (int)pNPCTopics[351].pText;
-				if ( v27 )
-				  v29 = (int)pNPCTopics[353].pText;
-				dword_F8B1A4 = (char *)v29;
-			  }
-			  else
-			  {
-				if ( v26 != v13 )
-				{
-				  party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
-				  v28 = pParty->pPlayers;
-				  do
-				  {
-					v28->SetVariable(VAR_Award, 86);
-					++v28;
-				  }
-				  while ( (signed int)v28 < (signed int)pParty->pHirelings );
-				  pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
-				  pParty->field_750[v25] = v13;
-				  pParty->field_75A[v25] = v13;
-				}
-				//v1 = 0;
-				dword_F8B1A4 = pNPCTopics[352].pText;
-			  }
-			}
-			else if ( uMessageParam == 100 )
-			{
-			  pKeyActionMap->EnterText(1, 10, v8);
-			}
-		}
-	  }
-  }
-  */
-  
-
-//LABEL_196:
-  switch ( uMessageParam )
-  {
-    case 96:
-		{
-        pDialogueWindow->eWindowType = WINDOW_MainMenu;
-        UI_CreateEndConversationButton();
-        FillAviableSkillsToTeach(in_current_building_type);
-        break;
-		}
-    case 101:
-		{
-        pDialogueWindow->eWindowType = WINDOW_MainMenu;
-        UI_CreateEndConversationButton();
-        sub_4B3A72(in_current_building_type);
-        break;
-		}
-    case 102:
-    case 103:
-		{
-        dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
-        break;
-		}
-    case 104:
-		{
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-        {
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
-          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
-          ++pMessageQueue_50CBD0->uNumMessages;
-        }*/
-        pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
-        dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
-        break;
-		}
-	case 2:
-	case 95:
-		{
-		if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
-		{
-			GenerateStandartShopItems();
-			GenerateSpecialShopItems();
-			v8 = window_SpeakInHouse;
-			v40 = window_SpeakInHouse->par1C;
-			//v3 = dword_F8B198;
-			v41 = pParty->uTimePlayed
-				//+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
-				+ (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
-									* 0.033333335);
-			pParty->field_3C.field_50[v40] = v41;
-   		}
-		v42 = v8->ptr_1C;
-		v43 = 0;
-		//v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
-		v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
-		if ( uMessageParam == 2 )
-		{
-			if ( uItemsAmountPerShopType[v44] )
-			{
-				do
-				{
-					v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
-					if ( v45 )
-					{
-						v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
-						//v3 = dword_F8B198;
-						v8 = window_SpeakInHouse;
-						ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
-					}
-					v42 = v8->ptr_1C;
-					++v43;
-				}
-				//while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-				while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-			}
-			if ( in_current_building_type == BildingType_WeaponShop )
-			{
-				v47 = v8->ptr_1C;
-				v48 = 0;
-				//if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
-				if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
-				{
-					do
-					{
-						// if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
-						if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID)
-						{
-							v49 = rand();
-							v8 = window_SpeakInHouse;
-							word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
-						}
-						v47 = v8->ptr_1C;
-						++v48;
-					}
-					//while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-					while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-				}
-			}
-		}
-		if ( uMessageParam == 95 )
-		{
-			if ( uItemsAmountPerShopType[v44] )
-			{
-				do
-				{
-					//v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
-					v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
-					if ( v50 )
-					{
-						v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
-						//v3 = dword_F8B198;
-						v8 = window_SpeakInHouse;
-						ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
-					}
-					v42 = v8->ptr_1C;
-					++v43;
-				}
-				//while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-				while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-			}
-			if ( in_current_building_type == BildingType_WeaponShop )
-			{
-				v52 = v8->ptr_1C;
-				v53 = 0;
-				//if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
-				if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
-				{
-					do
-					{
-						// if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
-						if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
-						{
-							v54 = rand();
-							v8 = window_SpeakInHouse;
-							word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
-						}
-						v52 = v8->ptr_1C;
-						++v53;
-					}
-					//while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-					while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
-				}
-			}
-		}
-		break;
-		}
-	case 3:
-	case 4:
-	case 5:
-		{
-		dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
-		sub_421B2C_PlaceInInventory_or_DropPickedItem();
-		break;
-		}
-	case 94:
-		{
-        pDialogueWindow->eWindowType = WINDOW_MainMenu;
-        UI_CreateEndConversationButton();
-        sub_4B3AD4(in_current_building_type);
-		break;
-		}
-	default:
-		{
-		if( uMessageParam >= 36 && uMessageParam <= 72 )
-		{
-			v35 = pPlayers[uActiveCharacter];
-			//v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
-			v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
-			v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
-			if ( v37 < v36 / 3 )
-			v37 = v36 / 3;
-              
-			__debugbreak();
-			//pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
-			// or
-			//byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
-			// or
-			//byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
-
-			//if (false)
-			if(byte_4ED970_skill_learn_ability_by_class_table[v35->classType][uMessageParam-36])
-			//if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
-			{
-			v38 = (int)(&v35->uIntelligence + uMessageParam);
-			if ( !*(short *)v38 )
-			{
-				if ( pParty->uNumGold < v37 )
-				{
-				ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-				if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
-					v39 = 4;
-				else
-					v39 = 2;
-				PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
-				}
-				else
-				{
-				Party::TakeGold(v37);
-				dword_F8B1E4 = 1;
-				*(short *)v38 = 1;
-				v35->PlaySound(SPEECH_78, 0);
-				}
-			}
-			}
-		}
-		break;
-		}
-  }
-  /*
-  if ( uMessageParam != 95 && uMessageParam != 2 )
-  {
-    if ( uMessageParam == 3 )
-    {
-      dialog_menu_id = 3;
-    }
-    else
-    {
-      if ( uMessageParam == 4 )
-      {
-        dialog_menu_id = 4;
-      }
-      else
-      {
-        if ( uMessageParam != 5 )
-        {
-          if ( uMessageParam > 35 )
-          {
-            if ( uMessageParam <= 72 )
-            {
-              v35 = pPlayers[uActiveCharacter];
-              //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
-              v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
-              v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
-              if ( v37 < v36 / 3 )
-                v37 = v36 / 3;
-              
-              __debugbreak();
-              //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
-              // or
-              //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
-              // or
-              //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
-
-              if (false)
-              //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
-              {
-                v38 = (int)(&v35->uIntelligence + uMessageParam);
-                if ( !*(short *)v38 )
-                {
-                  if ( pParty->uNumGold < v37 )
-                  {
-                    ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-                    if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
-                      v39 = 4;
-                    else
-                      v39 = 2;
-                    PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
-                  }
-                  else
-                  {
-                    Party::TakeGold(v37);
-                    dword_F8B1E4 = 1;
-                    *(short *)v38 = 1;
-                    v35->PlaySound(SPEECH_78, 0);
-                  }
-                }
-              }
-            }
-            else
-            {
-              if ( uMessageParam == 94 )
-              {
-                pDialogueWindow->eWindowType = WINDOW_MainMenu;
-                UI_CreateEndConversationButton();
-                sub_4B3AD4(in_current_building_type);
-              }
-            }
-          }
-          return;
-        }
-        dialog_menu_id = 5;
-      }
-    }
-    sub_421B2C_PlaceInInventory_or_DropPickedItem();
-    return;
-  }
-  if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
-  {
-    GenerateStandartShopItems();
-    GenerateSpecialShopItems();
-    v8 = window_SpeakInHouse;
-    v40 = window_SpeakInHouse->par1C;
-    //v3 = dword_F8B198;
-    v41 = pParty->uTimePlayed
-        //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
-        + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
-                         * 0.033333335);
-    pParty->field_3C.field_50[v40] = v41;
-   
-  }
-  v42 = v8->ptr_1C;
-  v43 = 0;
-  //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
-  v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
-  if ( uMessageParam == 2 )
-  {
-    if ( uItemsAmountPerShopType[v44] )
-    {
-      do
-      {
-        v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
-        if ( v45 )
-        {
-          v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
-          //v3 = dword_F8B198;
-          v8 = window_SpeakInHouse;
-          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
-        }
-        v42 = v8->ptr_1C;
-        ++v43;
-      }
-      //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-      while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-    }
-    if ( in_current_building_type == BildingType_WeaponShop )
-    {
-      v47 = v8->ptr_1C;
-      v48 = 0;
-      //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
-      if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
-      {
-        do
-        {
-         // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
-		 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
-          {
-            v49 = rand();
-            v8 = window_SpeakInHouse;
-            word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
-          }
-          v47 = v8->ptr_1C;
-          ++v48;
-        }
-        //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-        while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-      }
-    }
-  }
-  if ( uMessageParam == 95 )
-  {
-    if ( uItemsAmountPerShopType[v44] )
-    {
-      do
-      {
-        //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
-	  v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
-        if ( v50 )
-        {
-          v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
-          //v3 = dword_F8B198;
-          v8 = window_SpeakInHouse;
-          ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
-        }
-        v42 = v8->ptr_1C;
-        ++v43;
-      }
-      //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-      while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
-    }
-    if ( in_current_building_type == BildingType_WeaponShop )
-    {
-      v52 = v8->ptr_1C;
-      v53 = 0;
-      //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
-      if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
-      {
-        do
-        {
-         // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
-		if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
-          {
-            v54 = rand();
-            v8 = window_SpeakInHouse;
-            word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
-          }
-          v52 = v8->ptr_1C;
-          ++v53;
-        }
-        //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
-        while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
-      }
-    }
-  }
-*/
-}
-
 //----- (004BD8B5) --------------------------------------------------------
 signed int __cdecl sub_4BD8B5()
 {
@@ -1999,10 +912,6 @@
   return 0;
 }
 
-
-
-
-
 //----- (004BDB56) --------------------------------------------------------
 void __cdecl UIShop_Buy_Identify_Repair()
 {
@@ -2477,8 +1386,6 @@
   }
 }
 
-
-
 //----- (004BE386) --------------------------------------------------------
 void __fastcall log_error(const char *pMessage)
 {
@@ -2497,9 +1404,6 @@
   }
 }
 
-
-
-
 //----- (004BF91E) --------------------------------------------------------
 unsigned int __thiscall GameOverMenu(void *ecx0)
 {
@@ -2699,12 +1603,6 @@
   return result;
 }
 
-
-
-
-
-
-
 //----- (004D6FB0) --------------------------------------------------------
 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(stru315 *a1/*<ebp>*/)
 {
@@ -3471,9 +2369,6 @@
   }
 }
 
-
-
-
 //----- (00451007) --------------------------------------------------------
 int stru350::sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch,
                                             unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch,
@@ -4722,12 +3617,6 @@
   }
 }
 
-
-
-
-
-
-
 //----- (0044E1EC) --------------------------------------------------------
 int TextureFrameTable::FromFileTxt(const char *Args)
 {
@@ -4846,13 +3735,6 @@
   return 1;
 }
 
-
-
-
-
-
-
-
 //----- (0044F57C) --------------------------------------------------------
 void SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *spawn, int a3, int a4, int a5)
 {
@@ -5134,9 +4016,6 @@
     //while ( (signed int)v53 < v56 );
 }
 
-
-
-
 //----- (0044FA4C) --------------------------------------------------------
 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3)
 {
@@ -5259,7 +4138,6 @@
   return result;
 }
 
-
 //----- (0044FFD8) --------------------------------------------------------
 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
 {
@@ -5435,7 +4313,6 @@
   return a1a.Create(0, 0, 0, 0);
 }
 
-
 //----- (00450521) --------------------------------------------------------
 signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6)
 {
@@ -5481,9 +4358,6 @@
   return a1.Create(0, 0, 0, 0);
 }
 
-
-
-
 //----- (0045063B) --------------------------------------------------------
 int __fastcall sub_45063B(MapInfo *a1, int a2)
 {
@@ -5637,8 +4511,6 @@
   return result;
 }
 
-
-
 //----- (00450929) --------------------------------------------------------
 int LevelDecoration::GetGlobalEvent()
 {
@@ -5842,7 +4714,6 @@
 }
 // 5C6DF8: using guessed type int dword_5C6DF8;
 
-
 //----- (00450DA3) --------------------------------------------------------
 int __cdecl GetAlertStatus()
 {
@@ -5855,8 +4726,6 @@
   return result;
 }
 
-
-
 //----- (00450DDE) --------------------------------------------------------
 stru350 *stru350::_450DDE()
 {
@@ -5864,7 +4733,6 @@
   return this;
 }
 
-
 //----- (00450DF1) --------------------------------------------------------
 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2)
 {
@@ -6065,9 +4933,6 @@
   return true;
 }
 
-
-
-
 //----- (00450F55) --------------------------------------------------------
 unsigned int stru350::_450F55(int a2)
 {
@@ -6092,7 +4957,6 @@
   return v2 | ((a2 & field_0.field_10) << field_48) | ((a2 & field_0.field_14) << field_50) | ((a2 & field_0.field_18) << field_58);
 }
 
-
 //----- (00452442) --------------------------------------------------------
 unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
 {
@@ -6126,8 +4990,6 @@
                                                                     + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
 }
 
-
-
 //----- (0045281E) --------------------------------------------------------
 //    Calculates atan2(y/x)
 // return value: angle in integer format (multiplier of Pi/1024)  
@@ -6238,9 +5100,6 @@
   return 0;
 }
 
-
-
-
 //----- (00452969) --------------------------------------------------------
 stru193_math::stru193_math()
 {
@@ -6402,11 +5261,6 @@
   return result;
 }
 
-
-
-
-
-
 //----- (00453F62) --------------------------------------------------------
 void MapStats::Initialize()
 {
@@ -6735,11 +5589,6 @@
 }
 // 453F62: using guessed type char Str[32];
 
-
-
-
-
-
 //----- (004547A3) --------------------------------------------------------
 MAP_TYPE MapStats::GetMapInfo(const char *Str2)
 {
@@ -6807,11 +5656,6 @@
   }
 }
 
-
-
-
-
-
 //----- (00458244) --------------------------------------------------------
 unsigned int __fastcall SkillToMastery(unsigned __int16 a1)
 {
@@ -6837,7 +5681,6 @@
   return result;
 }
 
-
 //----- (0045828B) --------------------------------------------------------
 unsigned int __fastcall GetSpellColor(signed int a1)
 {
@@ -6954,7 +5797,6 @@
   return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
 }
 
-
 //----- (004583B0) --------------------------------------------------------
 LevelDecoration::LevelDecoration()
 {
@@ -6969,14 +5811,6 @@
   this->uCog = 0;
 }
 
-
-
-
-
-
-
-
-
 //----- (00458600) --------------------------------------------------------
 void DecorationList::ToFile()
 {
@@ -7207,10 +6041,6 @@
   return 1;
 }
 
-
-
-
-
 //----- (00459064) --------------------------------------------------------
 void ObjectList::InitializeSprites()
 {
@@ -7425,7 +6255,6 @@
   return 1;
 }
 
-
 //----- (0045E03A) --------------------------------------------------------
 unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height)
 {
@@ -7608,10 +6437,6 @@
   free(v2);
 }
 
-
-
-
-
 //----- (00460706) --------------------------------------------------------
 void TryLoadLevelFromLOD()
 {
@@ -7668,10 +6493,6 @@
   return false;
 }
 
-
-
-
-
 //----- (0046086A) --------------------------------------------------------
 bool Autosave()
 {
@@ -7735,7 +6556,6 @@
   return flag;
 }
 
-
 //----- (004610AA) --------------------------------------------------------
 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
 {
@@ -7929,8 +6749,6 @@
     pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
 }
 
-
-
 //----- (004613C4) --------------------------------------------------------
 int __cdecl sub_4613C4()
 {
@@ -7965,18 +6783,6 @@
 }
 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
 
-
-
-
-
-
-
-
-
-
-
-
-
 //----- (004621DA) --------------------------------------------------------
 int __fastcall int_get_vector_length(signed int a1, signed int a2, signed int a3)
 {
@@ -8007,11 +6813,6 @@
   return (11 * a2 >> 5) + a1 + (v4 >> 2);
 }
 
-
-
-
-
-
 OPENFILENAMEA ofn;
 //----- (0046271C) --------------------------------------------------------
 void __cdecl crt_init_globals_46271C()
@@ -8872,8 +7673,6 @@
     pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
 }
 
-
-
 //----- (004646F0) --------------------------------------------------------
 void PrepareWorld(unsigned int this_)
 {
@@ -8940,8 +7739,6 @@
   day_fogrange_2 = 5000;
 }
 
-
-
 //----- (00464866) --------------------------------------------------------
 void __fastcall DoPrepareWorld(unsigned int bLoading, int a2)
 {
@@ -9007,7 +7804,6 @@
   _flushall();
 }
 
-
 //----- (004649EF) --------------------------------------------------------
 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue)
 {
@@ -9373,9 +8169,6 @@
   }
 }
 
-
-
-
 //----- (004651F4) --------------------------------------------------------
 bool MM7_Initialize()
 {
@@ -9911,9 +8704,6 @@
   return true;
 }
 
-
-
-
 //----- (00465D0B) --------------------------------------------------------
 void __cdecl SecondaryInitialization()
 {
@@ -10017,11 +8807,6 @@
   dword_576E28 = 9;
 }
 
-
-
-
-
-
 void IntegrityTest()
 {
   assert(sizeof(RenderVertexSoft) == 0x30);
@@ -10365,10 +9150,6 @@
   return 1;
 }
 
-
-
-
-
 //----- (004637E0) --------------------------------------------------------
 char __cdecl sub_4637E0_is_there_popup_onscreen()
 {
@@ -10376,8 +9157,6 @@
 }
 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen;
 
-
-
 //----- (00465F5A) --------------------------------------------------------
 void __cdecl CreateAsyncMouse()
 {
@@ -10590,7 +9369,6 @@
     pOutdoorCamera->_485F64();
 }
 
-
 //----- (00466B8C) --------------------------------------------------------
 int __cdecl AbortWithError()
 {
@@ -10664,10 +9442,6 @@
   return uCurrentMenuID;
 }
 
-
-
-
-
 /*
     v17 = 0;
     if ( v4 > -2005532222 )
@@ -11170,16 +9944,12 @@
         }
       }*/
 
-
-
 //----- (00467D5D) --------------------------------------------------------
 int __thiscall sub_467D5D(int _this)
 {
   return *(int *)(_this + 7204);
 }
 
-
-
 //----- (00467E7F) --------------------------------------------------------
 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType)
 {
@@ -11301,9 +10071,6 @@
            0);
 }
 
-
-
-
 //----- (00468F8A) --------------------------------------------------------
 void __cdecl OnPaperdollLeftClick()
 {
@@ -11834,9 +10601,6 @@
   }
 }
 
-
-
-
 //----- (0046A0A1) --------------------------------------------------------
 int __thiscall UnprojectX(int x)
 {
@@ -12619,7 +11383,6 @@
   return v19;
 }
 
-
 //----- (0046BDA8) --------------------------------------------------------
 unsigned int __cdecl GetGravityStrength()
 {
@@ -12648,8 +11411,6 @@
   }
 }
 
-
-
 //----- (0046BDF1) --------------------------------------------------------
 void __cdecl BLV_UpdateUserInputAndOther()
 {
@@ -12696,9 +11457,6 @@
   _46CC4B_check_event_triggers();
 }
 
-
-
-
 //----- (0046BEF1) --------------------------------------------------------
 void SpriteObject::_46BEF1_apply_spells()
 {
@@ -12740,7 +11498,6 @@
   }
 }
 
-
 //----- (0046BFFA) --------------------------------------------------------
 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
 {
@@ -13773,4 +12530,3 @@
   pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
   return 0;
 }
-
--- a/mm7_3.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_3.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -43,16 +43,8 @@
 #include "stru298.h"
 #include "texts.h"
 #include "Log.h"
-
 #include "mm7_data.h"
 
-
-
-
-
-
-
-
 //----- (0046E44E) --------------------------------------------------------
 int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1)
 {
@@ -492,7 +484,6 @@
   return result;
 }
 
-
 //----- (0046ED1B) --------------------------------------------------------
 int _46ED1B_collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
 {
@@ -760,7 +751,6 @@
   return result;
 }
 
-
 //----- (0047050A) --------------------------------------------------------
 int stru141::_47050A(int a2)
 {
@@ -1358,9 +1348,6 @@
   while ( (signed int)v75 < (signed int)uNumActors );
 }
 
-
-
-
 //----- (0047253E) --------------------------------------------------------
 void UpdateObjects()
 {
@@ -2166,7 +2153,6 @@
     EventProcessor(uFaceEvent, 0, 1);
 }
 
-
 //----- (00473893) --------------------------------------------------------
 void __cdecl ODM_ProcessPartyActions()
 {
@@ -3431,8 +3417,6 @@
   return 1;
 }
 
-
-
 //----- (00475665) --------------------------------------------------------
 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
 {
@@ -3836,10 +3820,6 @@
   return 1;
 }
 
-
-
-
-
 //----- (004760D5) --------------------------------------------------------
 PartyAction ActionQueue::Next()
 {
@@ -3853,10 +3833,6 @@
 
   return result;
 }
-
-
-
-
 // 47730C: using guessed type int __stdcall const_1(int);
 
 //----- (0047752B) --------------------------------------------------------
@@ -3882,10 +3858,6 @@
   return v1 + v0->uReputation;
 }
 
-
-
-
-
 //----- (004775ED) --------------------------------------------------------
 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
 {
@@ -4491,8 +4463,6 @@
   return v16;
 }
 
-
-
 //----- (004783FA) --------------------------------------------------------
 void __cdecl sub_4783FA_construct_global_73D150()
 {
@@ -4510,8 +4480,6 @@
   while ( v1 );
 }
 
-
-
 //----- (0047840D) --------------------------------------------------------
 char Render::DrawBuildingsD3D()
 {
@@ -5407,9 +5375,6 @@
   return false;
 }
 
-
-
-
 //----- (00479295) --------------------------------------------------------
 int stru148::_479295()
 {
@@ -5551,8 +5516,6 @@
   return result;
 }
 
-
-
 unsigned short *LoadTgaTexture(const wchar_t *filename, int *out_width = nullptr, int *out_height = nullptr)
 {
   #pragma pack(push, 1)
@@ -5632,8 +5595,10 @@
               *skybox_yn, *skybox_yp,
               *skybox_zn, *skybox_zp;
 int            skybox_width, skybox_height;
+
 IDirect3DTexture2   *skybox_texture;
 IDirectDrawSurface4 *skybox_surface;
+
 bool Skybox_Initialize(const wchar_t *skybox_name)
 {
   wchar_t xn_filename[1024], xp_filename[1024],
@@ -5714,15 +5679,16 @@
   return true;
 }
 
-
 struct vector
 {
   float x, y, z;
 };
+
 struct matrix
 {
   float m[4][4];
 };
+
 void VectorNormalize(vector *v)
 {
   float invmag = 1.0f / sqrtf(v->x * v->x + v->y * v->y + v->z * v->z);
@@ -5730,6 +5696,7 @@
   v->y *= invmag;
   v->z *= invmag;
 }
+
 void MatrixRotationAxis(matrix *pout, CONST vector *pv, float angle)
 {
   memset(pout, 0, sizeof(matrix));
@@ -5752,6 +5719,7 @@
    pout->m[1][2] = (1.0f - cos(angle)) * v.z * v.y + sin(angle) * v.x;
     pout->m[2][2] = (1.0f - cos(angle)) * v.z * v.z + cos(angle);
 }
+
 void VectorTransform(const matrix *m, const vector *v, vector *out)
 {
   out->x = m->m[0][0] * v->x + m->m[1][0] * v->y + m->m[2][0] * v->z + m->m[3][0];
@@ -5759,7 +5727,6 @@
   out->z = m->m[0][2] * v->x + m->m[1][2] * v->y + m->m[2][2] * v->z + m->m[3][2];
 }
 
-
 bool DrawSkyD3D_Skybox()
 {
   static bool initialized = false,
@@ -6745,8 +6712,6 @@
   MM7Initialization();
 }
 
-
-
 //----- (0047A825) --------------------------------------------------------
 bool LevelDecoration::_47A825()
 {
@@ -6785,8 +6750,6 @@
   return v1;
 }
 
-
-
 //----- (0047BC6F) --------------------------------------------------------
 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
 {
@@ -6889,13 +6852,6 @@
 // 6BE040: using guessed type int day_fogrange_1;
 // 6BE044: using guessed type int day_fogrange_2;
 
-
-
-
-
-
-
-
 //----- (0047BEB1) --------------------------------------------------------
 int __fastcall sr_sub_47BEB1(signed int a1, stru148 *a2, int terrain_gamma, int a4, int *a5, int *a6, int a7, int a8)
 {
@@ -7207,10 +7163,8 @@
   }
   return result;
 }
-
 // 4D864C: using guessed type char byte_4D864C;
 
-
 //----- (0047C370) --------------------------------------------------------
 unsigned int __cdecl GetLevelFogColor()
 {
@@ -7311,7 +7265,6 @@
   return (-1 - v7) << 24;
 }
 
-
 //----- (0047C4FC) --------------------------------------------------------
 signed int __fastcall GetActorTintColor(int max_dimm, int min_dimm, float distance, int a4, RenderBillboard *a5)
 {
@@ -7452,9 +7405,6 @@
 }
 // 6BE3C4: using guessed type char bUnderwater;
 
-
-
-
 //----- (0047F44B) --------------------------------------------------------
 unsigned int __stdcall WorldPosToGridCellX(signed int sWorldPosX)
 {
@@ -7531,9 +7481,6 @@
   //while ( (signed int)v4 < (signed int)arary_77E5C8 );
 }
 
-
-
-
 //----- (004811A3) --------------------------------------------------------
 void stru148::_4811A3()
 {
@@ -7548,8 +7495,6 @@
   pRenderer->DrawTerrainPolygon(uNumVertices, this, pBitmaps_LOD->pHardwareTextures[uTileBitmapID], 1, 1);
 }
 
-
-
 //----- (00481DB2) --------------------------------------------------------
 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
 {
@@ -7588,8 +7533,6 @@
 // 50B570: using guessed type int dword_50B570[];
 // 50B638: using guessed type int dword_50B638[];
 
-
-
 //----- (00481E55) --------------------------------------------------------
 void OutdoorCamera::Project(unsigned int uNumVertices)
 {
@@ -7720,8 +7663,6 @@
     return false;
 }
 
-
-
 //----- (004823F4) --------------------------------------------------------
 bool IsTerrainSlopeTooHigh(int pos_x, int pos_z)
 {
@@ -7814,7 +7755,6 @@
   return y3 - v10 > 512;*/
 }
 
-
 //----- (0048257A) --------------------------------------------------------
 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
 {
@@ -7886,7 +7826,6 @@
   return result;
 }
 
-
 //----- (0048276F) --------------------------------------------------------
 void stru148::_48276F_sr()
 {
@@ -8070,7 +8009,6 @@
   return 1;
 }
 
-
 //----- (00482A94) --------------------------------------------------------
 int sr_sub_482A94(Span *_this)
 {
@@ -8703,7 +8641,6 @@
   return 0;
 }
 
-
 //----- (004839BD) --------------------------------------------------------
 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
 {
@@ -9018,8 +8955,6 @@
 // 6BE0E8: using guessed type int mipmapping_building_mm2;
 // 6BE0EC: using guessed type int mipmapping_building_mm3;
 
-
-
 //----- (0048408A) --------------------------------------------------------
 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
 {
@@ -9199,8 +9134,6 @@
   return 1;
 }
 
-
-
 //----- (00484442) --------------------------------------------------------
 signed int sr_sub_484442(Span *_this)
 {
@@ -9365,7 +9298,6 @@
   return 1;
 }
 
-
 //----- (004847EB) --------------------------------------------------------
 int sr_sub_4847EB(Span *_this)
 {
@@ -9740,8 +9672,6 @@
 // 80AA1C: using guessed type int dword_80AA1C;
 // 80AA20: using guessed type int dword_80AA20;
 
-
-
 //----- (00485407) --------------------------------------------------------
 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
 {
@@ -9947,7 +9877,6 @@
   return 1;
 }
 
-
 //----- (0048585C) --------------------------------------------------------
 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
 {
@@ -10499,8 +10428,6 @@
     v->y = 0;
 }
 
-
-
 //----- (00485F64) --------------------------------------------------------
 void OutdoorCamera::_485F64()
 {
@@ -10535,7 +10462,6 @@
   camera_rotation_x_int_cosine = stru_5C6E00->Cos(pIndoorCamera->sRotationX);
 }
 
-
 //----- (0048607B) --------------------------------------------------------
 void stru148::_48607B(stru149 *a2)
 {
@@ -10836,7 +10762,6 @@
   return result;
 }
 
-
 //----- (00486A28) --------------------------------------------------------
 void OutdoorCamera::AllocSoftwareDrawBuffers()
 {
@@ -11085,8 +11010,6 @@
   return v7;
 }
 
-
-
 //----- (0043F953) --------------------------------------------------------
 void PrepareBspRenderList_BLV()
 {
@@ -11301,7 +11224,6 @@
         }
 }
 
-
 //----- (0044028F) --------------------------------------------------------
 void PrepareItemsRenderList_BLV()
 {
@@ -11465,8 +11387,6 @@
   }
 }
 
-
-
 //----- (00440639) --------------------------------------------------------
 void AddBspNodeToRenderList(unsigned int node_id)
 {
@@ -11615,8 +11535,6 @@
 }
 // 4E28F8: using guessed type int pCurrentScreen;
 
-
-
 //----- (00441A4E) --------------------------------------------------------
 __int16 __fastcall sub_441A4E(int a1)
 {
@@ -11692,11 +11610,6 @@
   return result;
 }
 
-
-
-
-
-
 //----- (00443801) --------------------------------------------------------
 void Initialize2DA()
 {
@@ -11925,7 +11838,6 @@
 
 }
 
-
 //----- (00443E31) --------------------------------------------------------
 void LoadLevel_InitializeLevelStr()
     {
@@ -11973,7 +11885,6 @@
   }
 }
 
-
 //----- (00443F95) --------------------------------------------------------
 void __cdecl OnMapLeave()
 {
@@ -11993,10 +11904,9 @@
   }
 }
 
-
 //----- (00443FDC) --------------------------------------------------------
 void OnMapLoad()
-	{
+{
 	stru176 *v3; // esi@7
 	__int16 v4; // cx@9
 	__int16 v5; // di@9
@@ -12027,23 +11937,23 @@
 	__int16 v33; // [sp+4Eh] [bp-2h]@9
 
 	for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
-		{
+	{
 		auto pEvent = pLevelEVT_Index[i];
 
 		auto _evt = (_evt_raw *)(pLevelEVT + pEvent.uEventOffsetInEVT);
 
 		if (_evt->_e_type == EVENT_PlaySound)
-			{
+		{
 			pSoundList->LoadSound(EVT_DWORD(_evt->v5), 0);
-			}
+		}
 		else if (_evt->_e_type == EVENT_OnMapReload)
-			{
+		{
 			start_event_seq_number = pEvent.event_sequence_num;
 			EventProcessor(pEvent.uEventID, 0, 0);
 			start_event_seq_number = 0;
-			}
+		}
 		else if (_evt->_e_type == EVENT_OnTimer || _evt->_e_type == EVENT_OnLongTimer)
-			{
+		{
 			v3 = &array_5B5928_timers[dword_5B65C8_timers_count];
 			v20 = pOutdoor->uLastVisitDay;
 			if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
@@ -12066,7 +11976,7 @@
 			v3->field_C = ((unsigned short)_evt->v12 << 8) + _evt->v11;
 			v3->field_E = ((unsigned short)_evt->v12 << 8) + _evt->v11;
 			if (v3->timer_evt_type  == EVENT_OnLongTimer && !(short)v6 )
-				{
+			{
 				if ( v20 )
 					v18 = pParty->uTimePlayed - v20;
 				else
@@ -12074,25 +11984,25 @@
 				v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24;
 
 				if ( v26 / 7 / 4 / 12 )
-					{
+				{
 					if ( v3->field_10 )
-						{
+					{
 						++dword_5B65C8_timers_count;
 						v3->field_0_time = 0;
 						continue;
-						}
 					}
+				}
 				if (v26 / 7 / 4 != 0 && v3->field_12 != 0 ||
 					v26 / 7 != 0 && v3->field_14 != 0 ||
 					v26 != 0 || !v20)
-					{
+				{
 					++dword_5B65C8_timers_count;
 					v3->field_0_time = 0;
 					continue;
-					}
 				}
+			}
 			else
-				{
+			{
 				v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
 				v9 = v8;
 				v10 = (signed int)v8 / 60;
@@ -12118,30 +12028,30 @@
 				weeks = v15;
 				months = v16 % 12;
 				if ( v3->field_10 )
-					{
+				{
 					++years;
-					}
+				}
 				else
-					{
+				{
 					if ( v3->field_12 )
+					{
+						++months;
+					}
+					else
+					{
+						if ( v3->field_14 )
 						{
-						++months;
+							++weeks;
 						}
-					else
+						else
 						{
-						if ( v3->field_14 )
-							{
-							++weeks;
-							}
-						else
-							{
 							++days;
 							minutes = v3->field_18;
 							hours = v3->field_16;
 							seconds = v3->field_1A;
-							}
 						}
 					}
+				}
 				v3->field_0_time = (signed __int64)((double)((seconds
 					+ 60 * minutes
 					+ 3600 * hours
@@ -12151,10 +12061,10 @@
 					* 0.033333335);
 
 				++dword_5B65C8_timers_count;
-				}
 			}
 		}
 	}
+}
 
 //----- (00444360) --------------------------------------------------------
 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
@@ -12361,9 +12271,6 @@
   return result;
 }
 
-
-
-
 //----- (00444A51) --------------------------------------------------------
 void TransitionUI_Draw()
 {
@@ -12418,7 +12325,6 @@
   _unused_5B5924_is_travel_ui_drawn = true;
 }
 
-
 //----- (00444C8F) --------------------------------------------------------
 GUIWindow *__cdecl UI_CreateTravelDialogue()
 {
@@ -12539,7 +12445,6 @@
   }
 }
 
-
 //----- (00444FBE) --------------------------------------------------------
 void __cdecl DrawBranchlessDialogueUI()
 {
@@ -12644,7 +12549,6 @@
   pEventTimer->Resume();
 }
 
-
 //----- (00445308) --------------------------------------------------------
 const char *GetProfessionActionText(int a1)
 {
@@ -13018,235 +12922,6 @@
   pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
 }
 
-//----- (004459F9) --------------------------------------------------------
-NPCData *__fastcall GetNPCData(signed int npcid)
-{
-  unsigned int v1; // esi@1
-  NPCData *result; // eax@5
-  int v3; // esi@9
-  int v4; // ecx@9
-  //int v5; // edx@9
-  //NPCData *v6; // eax@9
-  char *v7; // ebx@14
-  NPCData *v8; // edi@14
-  char v9; // al@22
-  char v10;
-  //std::string v10; // [sp-18h] [bp-2Ch]@4
-  int v11;
-  //const char *v11; // [sp-8h] [bp-1Ch]@4
-  int v12; // [sp-4h] [bp-18h]@4
-  int v13; 
-  char *v14;
-  //std::string *v13; // [sp+Ch] [bp-8h]@4
-  int a3; // [sp+13h] [bp-1h]@4
-  int i;
-
-  /*v1 = npcid;
-  if ( (npcid & 0x80000000u) == 0 )
-  {
-    if ( (signed int)npcid < 5000 )
-    {
-      if ( (signed int)npcid >= 501 )
-      {
-    MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
-      }
-      return &pNPCStats->pNewNPCData[v1];
-    }
-    return &pNPCStats->array_13EF4[npcid - 5000];
-  }
-  if ( (signed int)npcid >= 5000 )
-    return &pNPCStats->array_13EF4[npcid - 5000];
-  if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
-  {
-    result = 0;
-  }
-  else
-  {
-    v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
-    v4 = 0;
-    v5 = 0;
-    v6 = pParty->pHirelings;
-    do
-    {
-      if ( v6->pName )
-        pTmpBuf[v4++] = v5;
-      ++v6;
-      ++v5;
-    }
-    while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
-    v13 = 0;
-    if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
-    {
-      v7 = &pTmpBuf[v4];
-      v8 = pNPCStats->pNewNPCData;
-      do
-      {
-        if ( v8->uFlags & 0x80
-          && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
-          && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
-          *v7++ = (char)v13 + 2;
-        v13 = (std::string *)((char *)v13 + 1);
-        ++v8;
-      }
-      while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
-    }
-    v9 = pTmpBuf[v3];
-    if ( (unsigned __int8)v9 >= 2u )
-      result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
-    else
-      result = &pParty->pHirelings[(unsigned __int8)v9];
-  }
-  return result;*/
-  v1 = npcid;
-  if ( npcid >= 0 )
-  {
-    if ( npcid < 5000 )
-    {
-      if ( npcid >= 501 )
-      {
-        MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
-      }
-      return &pNPCStats->pNewNPCData[v1];// - 1];
-    }
-    return &pNPCStats->pAdditionalNPC[npcid - 5000];
-  }
-
-
-  if ( npcid >= 5000 )
-    return &pNPCStats->pAdditionalNPC[npcid - 5000];
-  if (sDialogue_SpeakingActorNPC_ID >= 0)
-  {
-    result = 0;
-  }
-  else
-  {
-    v3 = abs(sDialogue_SpeakingActorNPC_ID) - 1;
-    v4 = 0;
-
-    for (i = 0; i < 2; ++i)
-    {
-      if (pParty->pHirelings[i].pName)
-        pTmpBuf[v4++] = i;
-    }
-
-    if (pNPCStats->uNumNewNPCs > 0)
-    {
-      for (i = 0; i < pNPCStats->uNumNewNPCs; ++i)
-      {
-        if (pNPCStats->pNewNPCData[i].Hired())
-        {
-          if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
-          {
-            if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
-              pTmpBuf[v4++] = i + 2;
-          }
-        }
-      }
-    }
-
-    v9 = pTmpBuf[v3];
-    if ( v9 >= 2 )
-     result = &pNPCStats->pNPCData[499 + v9];
-    else
-      result = &pParty->pHirelings[v9];
-  }
-}
-
-//----- (00445B2C) --------------------------------------------------------
-NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
-{
-  signed int v2; // esi@1
-  int v3; // edi@1
-  NPCData *result; // eax@5
-  int v5; // esi@9
-  int v6; // ecx@9
-  int v7; // edx@9
-  NPCData *v8; // eax@9
-  NPCData *v9; // edi@14
-  int v10; // ecx@20
-  char v11; // al@23
-  std::string v12; // [sp-18h] [bp-34h]@4
-  const char *v13; // [sp-8h] [bp-24h]@4
-  int v14; // [sp-4h] [bp-20h]@4
-  std::string *v15; // [sp+Ch] [bp-10h]@1
-  char *v16; // [sp+10h] [bp-Ch]@14
-  int v17; // [sp+14h] [bp-8h]@13
-  int a3; // [sp+1Bh] [bp-1h]@4
-
-  v2 = npcid;
-  v3 = a2;
-  v15 = (std::string *)a2;
-  if ( npcid >= 0 )
-  {
-    if ( npcid < 5000 )
-    {
-      if ( npcid >= 501 )
-      {
-    MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:2040", 0);
-      }
-      *(int *)v3 = v2;
-      return &pNPCStats->pNewNPCData[v2];
-    }
-LABEL_7:
-    *(int *)a2 = npcid - 5000;
-    return &pNPCStats->pAdditionalNPC[npcid - 5000];
-  }
-  if ( npcid >= 5000 )
-    goto LABEL_7;
-  if ( sDialogue_SpeakingActorNPC_ID >= 0 )
-  {
-    *(int *)a2 = 0;
-    result = 0;
-  }
-  else
-  {
-    v5 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
-    v6 = 0;
-    v7 = 0;
-    v8 = pParty->pHirelings;
-    do
-    {
-      if ( v8->pName )
-        pTmpBuf[v6++] = v7;
-      ++v8;
-      ++v7;
-    }
-    while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
-    v17 = 0;
-    if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
-    {
-      v9 = pNPCStats->pNewNPCData;
-      v16 = &pTmpBuf[v6];
-      do
-      {
-        if ( v9->Hired()
-          && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
-          && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
-        {
-          v10 = (int)v16++;
-          *(char *)v10 = v17 + 2;
-        }
-        ++v17;
-        ++v9;
-      }
-      while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
-      v3 = (int)v15;
-    }
-    v11 = pTmpBuf[v5];
-    if ( (unsigned __int8)v11 >= 2u )
-    {
-      *(int *)v3 = (unsigned __int8)v11 - 2;
-      result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
-    }
-    else
-    {
-      *(int *)v3 = (unsigned __int8)v11;
-      result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
-    }
-  }
-  return result;
-}
-
 //----- (00445C8B) --------------------------------------------------------
 int __fastcall sub_445C8B(signed int a1)
 {
@@ -13298,7 +12973,6 @@
   return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
 }
 
-
 //----- (0044603D) --------------------------------------------------------
 void __cdecl sub_44603D()
 {
@@ -13309,7 +12983,6 @@
   pEventTimer->Resume();
 }
 
-
 //----- (004465DF) --------------------------------------------------------
 int sub_4465DF_check_season(int a1)
 {
@@ -13508,8 +13181,6 @@
   return result;
 }
 
-
-
 //----- (0044861E) --------------------------------------------------------
 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
 {
@@ -13635,9 +13306,6 @@
   }
 }
 
-
-
-
 //----- (0044882F) --------------------------------------------------------
 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
 {
@@ -13676,7 +13344,6 @@
   }
 }
 
-
 //----- (004488B6) --------------------------------------------------------
 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
 {
@@ -13706,7 +13373,6 @@
   return result;
 }
 
-
 //----- (0044892E) --------------------------------------------------------
 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
 {
@@ -13785,30 +13451,6 @@
   }
 }
 
-
-
-
-//----- (00448A40) --------------------------------------------------------
-void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
-{
-  if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
-  {
-    if ( bToggle )
-    {
-      pActors[uActorID].uAttributes |= uFlag;
-    }
-    else
-    {
-      if ( uFlag == 0x10000 )
-      {
-        if (pActors[uActorID].uAIState == Disabled )
-          pActors[uActorID].uAIState = Standing;
-      }
-      pActors[uActorID].uAttributes &= ~uFlag;
-    }
-  }
-}
-
 //----- (00448A98) --------------------------------------------------------
 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
 {
@@ -13877,7 +13519,6 @@
   }
 }
 
-
 //----- (00448B45) --------------------------------------------------------
 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
 {
@@ -13993,7 +13634,6 @@
   v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
 }
 
-
 //----- (00448CF4) --------------------------------------------------------
 void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName)
 {
@@ -14040,7 +13680,6 @@
   }
 }
 
-
 //----- (00448DF8) --------------------------------------------------------
 void __fastcall sub_448DF8_cast_spell(int spellnum, int rank, int level, int fromx, int fromy, int fromz, int tox, int toy, int toz)
 {
@@ -14846,7 +14485,6 @@
     pArray[v3 / 8] &= ~set_bit;
 }
 
-
 //----- (0044A56A) --------------------------------------------------------
 void __cdecl Party__CountHirelings()
 {
@@ -14864,7 +14502,6 @@
   }
 }
 
-
 //----- (0044C175) --------------------------------------------------------
 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
 {
@@ -14887,7 +14524,6 @@
     ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
 }
 
-
 //----- (0044C28B) --------------------------------------------------------
 signed int __cdecl const_2()
 {
@@ -14917,7 +14553,6 @@
   return result;
 }
 
-
 //----- (0044C2F4) --------------------------------------------------------
 int LevelDecoration::IsInteractive()
 {
@@ -14974,11 +14609,6 @@
   v1->z = LODWORD(v14);
 }
 
-
-
-
-
-
 //----- (00401000) --------------------------------------------------------
 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
 {
@@ -14999,7 +14629,6 @@
   }
 }
 
-
 //----- (004014E6) --------------------------------------------------------
 void MakeActorAIList_ODM()
 {
@@ -16098,9 +15727,6 @@
   }
 }
 
-
-
-
 //----- (0040261D) --------------------------------------------------------
 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
 {
@@ -16121,10 +15747,6 @@
   return result;
 }
 
-
-
-
-
 //----- (00402CAE) --------------------------------------------------------
 int stru193_math::Cos(int angle)
 {
@@ -16143,19 +15765,6 @@
     return pCosTable[v2];
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 //----- (00404544) --------------------------------------------------------
 signed int stru262_TurnBased::_404544()
 {
@@ -16305,30 +15914,6 @@
   }
 }
 
-
-//----- (00404828) --------------------------------------------------------
-SpriteObject::SpriteObject()
-{
-  field_22_glow_radius_multiplier = 1;
-  uSoundID = 0;
-  uFacing = 0;
-  vVelocity.z = 0;
-  vVelocity.y = 0;
-  vVelocity.x = 0;
-  uType = 0;
-  uObjectDescID = 0;
-  field_61 = 0;
-  field_60_distance_related_prolly_lod = 0;
-  field_20 = 0;
-  uSpriteFrameID = 0;
-  field_50 = 0;
-  field_4C = 0;
-  field_48 = 0;
-  field_54 = 0;
-}
-
-
-
 //----- (004059DB) --------------------------------------------------------
 signed int stru262_TurnBased::Start()
 {
@@ -16545,4 +16130,3 @@
   }
   return v1->_404544();
 }
-
--- a/mm7_4.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_4.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -3,7 +3,6 @@
 #include <assert.h>
 
 #include "MM7.h"
-
 #include "MapInfo.h"
 #include "Game.h"
 #include "GUIWindow.h"
@@ -54,23 +53,8 @@
 #include "texts.h"
 #include "Log.h"
 #include "UIHouses.h"
-
 #include "mm7_data.h"
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 //----- (0046CC4B) --------------------------------------------------------
 void __cdecl _46CC4B_check_event_triggers()
 {
@@ -842,7 +826,6 @@
   return dword_720F20[v22];
 }
 
-
 //not sure if right- or left-handed coordinate space assumed, so this could be normal of inverse normal
 // for a right-handed system, that would be an inverse normal
 //----- (0046DCC8) --------------------------------------------------------
@@ -916,7 +899,6 @@
   }
 }
 
-
 //----- (0046DEF2) --------------------------------------------------------
 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID)
 {
@@ -1452,8 +1434,6 @@
 }
 // 4EC3EC: using guessed type Edge defaultEdge;
 
-
-
 //----- (00487355) --------------------------------------------------------
 bool OutdoorCamera::_487355()
 {
@@ -1476,8 +1456,6 @@
   return result;
 }
 
-
-
 //----- (00487DA9) --------------------------------------------------------
 void __cdecl sub_487DA9()
 {
@@ -1519,10 +1497,6 @@
 }
 // 4EC3EC: using guessed type Edge defaultEdge;
 
-
-
-
-
 //----- (0048958E) --------------------------------------------------------
 stru12_MemoryBlock::stru12_MemoryBlock(int a2)
 {
@@ -1795,10 +1769,6 @@
   this->field_8C = 0;
 }
 
-
-
-
-
 //----- (0048A959) --------------------------------------------------------
 unsigned int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace)
 {
@@ -1822,7 +1792,6 @@
          ((uint)floorf(b * 255.0f + 0.5f) & 0xFF);
 }
 
-
 //----- (0048B561) --------------------------------------------------------
 int _48B561_mess_with_scaling_along_z(/*int a1, */float a2)
 {
@@ -1836,11 +1805,6 @@
   return v5 | (v4 << 16);
 }
 
-
-
-
-
-
 //----- (00491E3A) --------------------------------------------------------
 void __cdecl sub_491E3A()
 {
@@ -1942,9 +1906,6 @@
 }
 // 4ED498: using guessed type char byte_4ED498;
 
-
-
-
 //----- (0049387A) --------------------------------------------------------
 int CycleCharacter(unsigned int _this)
 {
@@ -2380,8 +2341,6 @@
   return result;
 }
 
-
-
 //----- (00493F79) --------------------------------------------------------
 void sub_493F79(stru351_summoned_item *_this, __int64 a2)
 {
@@ -2405,10 +2364,6 @@
   _this->field_18_expire_year = v6 / 0xC + game_starting_year;
 }
 
-
-
-
-
 //----- (00494035) --------------------------------------------------------
 void __cdecl _494035_timed_effects__water_walking_damage__etc()
 {
@@ -2908,8 +2863,6 @@
 }
 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
 
-
-
 //----- (00494AED) --------------------------------------------------------
 unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression)
 {
@@ -3385,8 +3338,6 @@
   return result;
 }
 
-
-
 //----- (00495366) --------------------------------------------------------
 char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2)
 {
@@ -3895,9 +3846,6 @@
   return pTmpBuf2;
 }
 
-
-
-
 //----- (0049B04D) --------------------------------------------------------
 void stru154::GetFacePlaneAndClassify(ODMFace *a2, BSPVertexBuffer *a3)
 {
@@ -4029,10 +3977,6 @@
   *pOutDist = (double)(v5->pFacePlane.dist & 0xFFFF) / 65535.0f + (double)(v5->pFacePlane.dist >> 16);
 }
 
-
-
-
-
 //----- (0049D700) --------------------------------------------------------
 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim)
 {
@@ -4051,15 +3995,6 @@
   return v3 == 0 ? v2 : 0;
 }
 
-
-
-
-
-
-
-
-
-
 //----- (004A19D8) --------------------------------------------------------
 unsigned int BlendColors(unsigned int a1, unsigned int a2)
 {
@@ -4102,8 +4037,6 @@
   return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8);*/
 }
 
-
-
 //----- (004A46E6) --------------------------------------------------------
 int __fastcall sr_4A46E6_draw_particle_segment(unsigned int x, signed int y, signed int _z, int a4, unsigned int lightColor)
 {
@@ -4243,7 +4176,6 @@
   return z;
 }
 
-
 //----- (004A57E9) --------------------------------------------------------
 void __cdecl Present_ColorKey()
 {
@@ -4472,8 +4404,6 @@
   }
 }
 
-
-
 //----- (004A7063) --------------------------------------------------------
 int __thiscall sub_4A7063(unsigned int uDiffuse, float a2)
 {
@@ -4521,13 +4451,6 @@
   return v10 | ((v9 | ((v7 | (v4 << 8)) << 8)) << 8);
 }
 
-
-
-
-
-
-
-
 //----- (004AD504) --------------------------------------------------------
 int __fastcall sub_4AD504(signed int sFaceID)
 {
@@ -5506,9 +5429,6 @@
 }
 // 4AE491: using guessed type int __fastcall sub_4AE491(int, int);
 
-
-
-
 //----- (004AE5F1) --------------------------------------------------------
 void __fastcall sub_4AE5F1(unsigned int uFaceID)
 {
@@ -6162,11 +6082,6 @@
   return result;
 }
 
-
-
-
-
-
 //----- (004B1447) --------------------------------------------------------
 Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3)
 {
@@ -6309,7 +6224,6 @@
   a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3);
 }
 
-
 //----- (004B1784) --------------------------------------------------------
 bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
 {
@@ -6344,7 +6258,6 @@
 }
 // F8B1E0: using guessed type int dword_F8B1E0;
 
-
 //view  item details  in shop?
 //----- (004B1A2D) --------------------------------------------------------
 void __cdecl sub_4B1A2D()
@@ -6548,8 +6461,6 @@
   }
 }
 
-
-
 //----- (004B1ECE) --------------------------------------------------------
 void __cdecl sub_4B1ECE()
 {
@@ -6645,7 +6556,6 @@
 	  v9->uHolderPlayer = v5;
   }
 }
-
 // 4F08EC: using guessed type int dword_4F08EC[];
 // 722B3C: using guessed type int dword_722B3C;
 // 722B44: using guessed type int dword_722B44;
@@ -6930,7 +6840,6 @@
   pVideoPlayer->_4BF5B2();//HouseVideo
 }
 
-
 //----- (004B254D) --------------------------------------------------------
 char *__thiscall _4B254D_SkillMasteryTeacher(int _this)
 {
@@ -7259,8 +7168,6 @@
   return pTmpBuf2;
 }
 
-
-
 //----- (004B29F2) --------------------------------------------------------
 const char * ContractSelectText( int pEventCode )
 	{
@@ -7293,7 +7200,6 @@
   }
 }
 
-
 //----- (004B2A74) --------------------------------------------------------
 void SimpleHouseAndBoatsDialog()
 {
@@ -7620,18 +7526,12 @@
   }
 }
 
-
-
-
-
 //----- (004B36CC) --------------------------------------------------------
 void CreateButtonInColumn( int column_pos, unsigned int control_id )
-	{
+{
      pDialogueWindow->CreateButton( 480, 30 * column_pos + 146, 140, 30,  1,  0, 0x195u,  control_id,  0,   "",   0);
 }
 
-
-
 //----- (004B3A72) --------------------------------------------------------
 void sub_4B3A72( int a1 )
 	{
@@ -7968,7 +7868,6 @@
   dialog_menu_id = HOUSE_DIALOGUE_OTHER;
 }
 
-
 //----- (004B4224) --------------------------------------------------------
 void _4B4224_UpdateNPCTopics( int _this )
 	{
@@ -8090,8 +7989,6 @@
  
 }
 
-
-
 //----- (004B46A5) --------------------------------------------------------
 char __fastcall DrawTextAtStatusBar(const char *sText, int font_color)
 {
@@ -8113,7 +8010,6 @@
   return 1000 * v1;
 }
 
-
 //----- (004BC49B) --------------------------------------------------------
 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType)
 {
@@ -8339,8 +8235,6 @@
 	dword_7241C8 = 0;
 }
 
-
-
 //----- (004BDAAF) --------------------------------------------------------
 bool __fastcall sub_4BDAAF(ItemGen *a1, int _2da_idx)
 {
@@ -8445,9 +8339,6 @@
 */
 }
 
-
-
-
 //----- (004B6478) --------------------------------------------------------
 void sub_4B6478()
     {
@@ -8656,331 +8547,6 @@
   return;
 }
 
-
-
-//----- (004B6943) --------------------------------------------------------
-void __cdecl TravelByTransport()
-{
-  GUIWindow *v0; // ebx@1
-  Player *v1; // esi@1
-  signed int v2; // edi@1
-  unsigned int v3; // eax@1
-  signed int v4; // ebx@1
-  stru365_travel_info *v5; // esi@7
-  int v6; // eax@9
-  int v7; // eax@9
-  int v8; // eax@12
-  int v9; // edi@12
-  int v10; // edx@12
-  int v11; // ecx@12
-  signed int v12; // esi@13
-  signed int v13; // edi@14
-  DWORD v14; // eax@26
-  DWORD v15; // edi@26
-  GUIWindow *v16; // ebx@36
-  int v17; // esi@36
-  int v18; // eax@36
-  int v19; // ecx@36
-  int v20; // esi@36
-  int v21; // eax@36
-  void *v22; // eax@39
-  int v23; // esi@39
-  GUIButton *v24; // ebx@39
-  signed int v25; // eax@41
-  //int v26; // esi@44
-  const char *v27; // eax@46
-  char *v28; // eax@62
-  int v29; // eax@62
-  unsigned int v30; // ecx@62
-  char *v31; // eax@63
-  MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
-  /*int v33; // [sp-38h] [bp-2C8h]@62
-  int v34; // [sp-34h] [bp-2C4h]@62
-  int v35; // [sp-30h] [bp-2C0h]@62
-  int v36; // [sp-2Ch] [bp-2BCh]@62
-  int v37; // [sp-28h] [bp-2B8h]@62
-  int v38; // [sp-24h] [bp-2B4h]@62
-  int v39; // [sp-20h] [bp-2B0h]@62
-  int v40; // [sp-1Ch] [bp-2ACh]@62
-  int v41; // [sp-18h] [bp-2A8h]@62
-  int v42; // [sp-14h] [bp-2A4h]@62
-  char *v43; // [sp-10h] [bp-2A0h]@62
-  char *v44; // [sp-Ch] [bp-29Ch]@62
-  unsigned int v45; // [sp-8h] [bp-298h]@62
-  char *v46; // [sp-4h] [bp-294h]@62
-  const char *v47[5]; // [sp+0h] [bp-290h]@7*/
-  char v48[100]; // [sp+14h] [bp-27Ch]@37
-  char v49[100]; // [sp+78h] [bp-218h]@68
-  char v50[100]; // [sp+DCh] [bp-1B4h]@68
-  char v51[100]; // [sp+140h] [bp-150h]@68
-  char Dest[100]; // [sp+1A4h] [bp-ECh]@36
-  GUIWindow v53; // [sp+208h] [bp-88h]@1
-  int v54; // [sp+25Ch] [bp-34h]@36
-  int v55; // [sp+260h] [bp-30h]@36
-  unsigned int v56; // [sp+264h] [bp-2Ch]@1
-  int v57; // [sp+268h] [bp-28h]@1
-  int v58; // [sp+26Ch] [bp-24h]@36
-  GUIWindow *v59; // [sp+270h] [bp-20h]@1
-  unsigned int v60; // [sp+274h] [bp-1Ch]@36
-  //Player *v61; // [sp+278h] [bp-18h]@1
-  int v62; // [sp+27Ch] [bp-14h]@36
-  int v63; // [sp+280h] [bp-10h]@14
-  char *a1; // [sp+284h] [bp-Ch]@37
-  unsigned int s1; // [sp+288h] [bp-8h]@1
-  int v66; // [sp+28Ch] [bp-4h]@48
-
-  v0 = window_SpeakInHouse;
-  memcpy(&v53, window_SpeakInHouse, sizeof(v53));
-  v2 = 255;
-  //v61 = pPlayers[uActiveCharacter];
-  v1 = pPlayers[uActiveCharacter];
-  v53.uFrameX = 483;
-  v53.uFrameWidth = 148;
-  v53.uFrameZ = 334;
-  v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
-  v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
-  v3 = 52 * (unsigned int)v0->ptr_1C;
-  //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
-  v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 27) - 1) & 0xFFFFFFE7) + 50);
-  //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
-  v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
-  s1 = v4 * (100 - v1->GetMerchant()) / 100;
-  if ( (signed int)s1 < v4 / 3 )
-    s1 = v4 / 3;
-  if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
-  {
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
-    {
-      v16 = pDialogueWindow;
-      v58 = -1;
-      v62 = 0;
-      v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
-      v59 = pDialogueWindow;
-      v54 = v17;
-      strcpy(Dest, "");
-      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
-      v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
-      v19 = v16->pNumPresenceButton;
-      v20 = v18 + v17 + 146;
-      v21 = v16->pStartingPosActiveItem;
-      v63 = v20;
-      v55 = v20;
-      v60 = v21;
-      if ( v21 >= v21 + v19 )
-        goto LABEL_71;
-      s1 = 2;
-      a1 = v48;
-      while ( 1 )
-      {
-        int v47 = v60;
-        v22 = window_SpeakInHouse->ptr_1C;
-        v23 = byte_4F0E10[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
-        //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
-        //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
-        v24 = v16->GetControl(v60);
-        if ( v23 != v58
-          && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = travel_schedule[v23].pSchedule[pParty->uDaysPlayed % 7]),
-              v25
-           && (travel_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, travel_schedule[v23].uQuestBit))) )
-        {
-          v58 = v23;
-          v27 = (const char *)v56;
-          if ( pDialogueWindow->pCurrentPosActiveItem != s1 )
-            v27 = (const char *)v57;
-          //v32.uRedbookTrackID = v27;
-          sprintf(a1, "\f%05d", v27);
-          v66 = travel_schedule[v23].uTravelTime;
-          if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
-          {
-            if ( CheckHiredNPCSpeciality(Sailor) )
-              v66 -= 2;
-            if ( CheckHiredNPCSpeciality(Navigator) )
-              v66 -= 3;
-            //v47 = Pirate;
-            if ( CheckHiredNPCSpeciality(Pirate) )
-              v66 -= 2;
-          }
-          else
-          {
-            //v47 = Horseman;
-            if ( CheckHiredNPCSpeciality(Horseman) )
-              v66 -= 2;
-          }
-          if ( CheckHiredNPCSpeciality(Explorer) )
-            --v66;
-          if ( v66 < 1 )
-            v66 = 1;
-          if ( v23 != v2 )
-          {
-            memcpy(&v32, &pMapStats->pInfos[travel_schedule[v23].uMapInfoID], 0x44u);
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
-              v66, v32.pName);
-            strcat(a1, pTmpBuf);
-            v28 = a1;
-            a1 += 100;
-            ++v62;
-            ++s1;
-            strcat(v28, "\n \n");
-            v24->uY = v63;
-            v29 = pFontArrus->CalcTextHeight(pTmpBuf, &v53, 0, 0);
-            v30 = v24->uY;
-            v24->uHeight = v29;
-            v2 = 255;
-            v24->uW = v30 + v29 - 1;
-            v63 += v54 + v29;
-          }
-        }
-        else
-        {
-          v31 = a1;
-          ++v62;
-          ++s1;
-          a1 += 100;
-          strcpy(v31, "");
-          if ( v24 )
-          {
-            v24->uW = 0;
-            v24->uHeight = 0;
-            v24->uY = 0;
-          }
-        }
-        ++v60;
-        if ( (signed int)v60 >= v59->pNumPresenceButton + v59->pStartingPosActiveItem )
-          break;
-        v16 = v59;
-      }
-      if ( v63 != v55 )
-      {
-        /*v47[1] = &Dest;
-        v47[0] = &v51;
-        v46 = &v50;
-        v45 = (unsigned int)&v49;
-        v44 = &v48;
-        v43 = pTmpBuf2;*/
-        sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48, v49, v50, v51, Dest);
-        v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
-      }
-      else
-      {
-LABEL_71:
-        v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
-                          v57, pGlobalTXT_LocalizationStrings[561], 3);
-        pAudioPlayer->StopChannels(-1, -1);
-      }
-    }
-  }
-  else
-  {
-    if ( dialog_menu_id > HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT && dialog_menu_id <= HOUSE_DIALOGUE_108 )
-    {
-      if ( pParty->uNumGold < s1 )
-      {
-        ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
-        PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
-          return;
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
-        pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
-        goto LABEL_33;*/
-        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
-      }
-      Party::TakeGold(s1);
-      //v47[1] = (const char *)7;
-      v5 = &travel_schedule[byte_4F0CD0[(unsigned int)window_SpeakInHouse->ptr_1C - 1][dialog_menu_id - 1]];
-      if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
-      {
-        if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) )
-        {
-          SaveGame(1, 0);
-          strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename);
-          v8 = v5->field_18;
-          v9 = v5->field_14;
-          v10 = v5->field_10;
-          dword_6BE364_game_settings_1 |= 1u;
-          _5B65B8_npcdata_hiword_house_or_other = 0;
-          dword_5B65BC = 0;
-          _5B65B4_npcdata_loword_house_or_other = v8;
-          v11 = *((int *)v5 + 3);
-          uGameState = 2;
-          _5B65A8_npcdata_uflags_or_other = v11;
-          _5B65AC_npcdata_fame_or_other = v10;
-          _5B65B0_npcdata_rep_or_other = v9;
-          dword_5B65C0 = v11 | v10 | v9 | v8;
-        }
-        else
-        {
-          v6 = v5->field_C;
-          pParty->sRotationX = 0;
-          pParty->vPosition.x = v6;
-          v7 = v5->field_10;
-          pIndoorCamera->sRotationY = 0;
-          pParty->uFlags |= 2u;
-          pParty->vPosition.y = v7;
-          pParty->vPosition.z = v5->field_14;
-          pParty->uFallStartY = pParty->vPosition.z;
-          pParty->sRotationY = v5->field_18;
-        }
-        PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
-        v12 = v5->uTravelTime;
-        int _v47;
-        if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
-        {
-          v63 = SPEECH_SetSail;
-          v13 = 2500;
-          if ( CheckHiredNPCSpeciality(Sailor) )
-            v12 -= 2;
-          if ( CheckHiredNPCSpeciality(Navigator) )
-            v12 -= 3;
-          //_v47 = 45;
-          if ( CheckHiredNPCSpeciality(Pirate) )
-            v12 -= 2;
-        }
-        else
-        {
-          v63 = SPEECH_CarriageReady;
-          v13 = 1500;
-          //_v47 = 35;
-          if ( CheckHiredNPCSpeciality(Horseman) )
-            v12 -= 2;
-        }
-        if ( CheckHiredNPCSpeciality(Explorer) )
-          --v12;
-        if ( v12 < 1 )
-          v12 = 1;
-        RestAndHeal(1440 * v12);
-        v1->PlaySound((PlayerSpeech)v63, 0);
-        v14 = GetTickCount();
-        v15 = v14 + v13;
-        if ( v15 < v14 )
-          v15 = v14;
-        while ( GetTickCount() < v15 )
-          sqrt(3.1415926);
-        while ( sub_4BD8B5() )
-          ;
-        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-        {
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-LABEL_33:
-          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-          ++pMessageQueue_50CBD0->uNumMessages;
-          return;
-        }*/
-      }
-      else
-      {
-        dialog_menu_id = HOUSE_DIALOGUE_MAIN;
-        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
-      }
-    }
-  }
-}
-
-
-
-
-
 //----- (00405CFF) --------------------------------------------------------
 void stru262_TurnBased::End(bool bPlaySound)
 {
@@ -9229,9 +8795,6 @@
   }
 }
 
-
-
-
 //----- (0043FDED) --------------------------------------------------------
 void PrepareActorRenderList_BLV()
 {
@@ -9446,9 +9009,6 @@
   }
 }
 
-
-
-
 //----- (00444732) --------------------------------------------------------
 char *GetEventHintString(unsigned int uEventID)
 {
@@ -9504,9 +9064,6 @@
   return result;
 }
 
-
-
-
 //----- (00444839) --------------------------------------------------------
 unsigned int __fastcall sub_444839_move_map(unsigned int a1, int a2, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
 {
@@ -9610,4 +9167,3 @@
     uCurrentHouse_Animation = v23;
   return result;
 }
-
--- a/mm7_5.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_5.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -1,7 +1,6 @@
 #include <assert.h>
 
 #include "mm7.h"
-
 #include "MapInfo.h"
 #include "Game.h"
 #include "GUIWindow.h"
@@ -45,24 +44,8 @@
 #include "texts.h"
 #include "Log.h"
 #include "UIHouses.h"
-
 #include "mm7_data.h"
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 //----- (004304E7) --------------------------------------------------------
 void __cdecl GameUI_MsgProc()
 {
@@ -3480,7 +3463,6 @@
   pStru277->_427E01_cast_spell();
 }
 
-
 //----- (004356FF) --------------------------------------------------------
 void __cdecl back_to_game()
 {
@@ -3493,6 +3475,7 @@
     pEventTimer->Resume();
   viewparams->bRedrawGameUI = 1;
 }
+
 //----- (00435748) --------------------------------------------------------
 void __cdecl GUI_MainMenuMessageProc()
 {
@@ -4014,15 +3997,6 @@
   v1->z = v2 * v1->z;
 }
 
-
-
-
-
-
-
-
-
-
 //----- (004385B5) --------------------------------------------------------
 void stru11::CheckCPU()
 {
@@ -4415,8 +4389,6 @@
   memcpy((char *)&v17->cpuid_80000002_registers2[0] + 1, v18, 0x30u);*/
 }
 
-
-
 //----- (00438BDF) --------------------------------------------------------
 bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype)
 {
@@ -4500,7 +4472,6 @@
   return result;
 }
 
-
 //----- (00438F8F) --------------------------------------------------------
 void __cdecl _438F8F_area_of_effect__damage_evaluate()
 {
@@ -5201,7 +5172,6 @@
 }
 // 4D864C: using guessed type char byte_4D864C;
 
-
 //----- (00439FCB) --------------------------------------------------------
 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4)
 {
@@ -5708,7 +5678,6 @@
   }
 }
 
-
 //----- (0043A97E) --------------------------------------------------------
 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2)
 {
@@ -5799,9 +5768,6 @@
   *z *= 65536 / (v5 | 1);
 }
 
-
-
-
 //----- (0043AE12) --------------------------------------------------------
 double __fastcall sub_43AE12(signed int a1)
 {
@@ -6051,8 +6017,6 @@
   }
 }
 
-
-
 //----- (0043C91D) --------------------------------------------------------
 int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4)
 {
@@ -6256,8 +6220,6 @@
   return result;
 }
 
-
-
 //----- (0043ED6F) --------------------------------------------------------
 bool _43ED6F_check_party_races(bool a1)
 {
@@ -6529,7 +6491,6 @@
   return result;
 }
 
-
 //----- (0043F333) --------------------------------------------------------
 void BspRenderer::MakeVisibleSectorList()
 {
@@ -6557,7 +6518,6 @@
   }
 }
 
-
 //----- (0043F515) --------------------------------------------------------
 void FindBillboardsLightLevels_BLV()
 {
@@ -9346,7 +9306,6 @@
   return !v114 || !v113;
 }
 
-
 //----- (00408768) --------------------------------------------------------
 void InitializeActors()
 {
@@ -9435,7 +9394,6 @@
   return result;
 }
 
-
 //----- (00408A27) --------------------------------------------------------
 unsigned int __thiscall SearchAliveActors(unsigned int *pTotalActors)
 {
@@ -9577,7 +9535,6 @@
   return v5;
 }
 
-
 //----- (00409BE8) --------------------------------------------------------
 void __cdecl sub_409BE8()
 {
@@ -9622,12 +9579,6 @@
 // 505888: using guessed type int amuint_505888;
 // 50588C: using guessed type int amuint_50588C;
 
-
-
-
-
-
-
 //----- (0040D75D) --------------------------------------------------------
 char __fastcall pPrimaryWindow_draws_text(int a1, const char *pText, int *pXY)
 {
@@ -9647,8 +9598,6 @@
            0);
 }
 
-
-
 //----- (0040DB27) --------------------------------------------------------
 void __fastcall DrawRect(Vec4_int_ *pXYZW, unsigned __int16 uColor, char bSolidFill)
 {
@@ -9675,9 +9624,6 @@
   pRenderer->EndScene();
 }
 
-
-
-
 //----- (0040DDB1) --------------------------------------------------------
 int __fastcall rand_interval(int a, int b)
 {
@@ -9722,7 +9668,6 @@
   pRenderer->Present();
 }
 
-
 //----- (0040DFA7) --------------------------------------------------------
 int __stdcall retzero_sub_40DFA7(int a1)
 {
@@ -9935,12 +9880,6 @@
   return result;
 }
 
-
-
-
-
-
-
 //----- (0040F82D) --------------------------------------------------------
 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue)
 {
@@ -10037,7 +9976,6 @@
   }
 }
 
-
 //----- (0040F92A) --------------------------------------------------------
 void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3)
 {
--- a/mm7_6.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_6.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -452,94 +452,6 @@
   return result;
 }
 
-
-
-//----- (004361EF) --------------------------------------------------------
-IndoorCameraD3D::IndoorCameraD3D()
-{
-  IndoorCameraD3D *v1; // esi@1
-  //double v2; // st7@1
-  //double v3; // st6@1
-  //double v4; // st5@1
-  //double v5; // st7@1
-  //double v6; // st6@1
-  //double v7; // st5@1
-
-  v1 = this;
-  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4);
-  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14);
-  //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24);
-  /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum,
-    24,
-    6,
-    (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4,
-    (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/
-  //v2 = 0;//(double)pBLVRenderParams->vPartyPos.z;
-  //v3 = 0;//(double)pBLVRenderParams->vPartyPos.y;
-  //v4 = 0;//(double)pBLVRenderParams->vPartyPos.x;
-  v1->field_108 = 0.0;
-  v1->blv_party_x = 0;
-  v1->blv_party_y = 0;
-  v1->blv_party_z = 0;
-  //v5 = 0;//(double)pBLVRenderParams->vPartyPos.z;
-  //v6 = 0;//(double)pBLVRenderParams->vPartyPos.y;
-  //v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300);
-  v1->field_138 = 0.0;
-  v1->blv_party_x_2 = 300;
-  v1->blv_party_y_2 = 0;
-  v1->blv_party_z_2 = 0;
-  v1->field_168 = 0.0;
-  v1->field_198 = 0.0;
-  v1->field_1C8 = 0.0;
-  v1->field_1F8 = 0.0;
-  v1->field_228 = 0.0;
-  v1->field_258 = 0.0;
-  v1->field_288 = 0.0;
-  v1->field_2B8 = 0.0;
-  v1->field_2E8 = 0.0;
-  v1->field_2BC = 0.0;
-  v1->field_2C0 = 0.0;
-  v1->field_2C4 = 0.0;
-  v1->field_318 = 0.0;
-  v1->field_2EC = 0.0;
-  v1->field_2F0 = 0.0;
-  v1->field_2F4 = 0.0;
-  v1->field_348 = 0.0;
-  v1->field_31C = 0.0;
-  v1->field_320 = 0.0;
-  v1->field_324 = 0.0;
-  v1->field_378 = 0.0;
-  v1->field_34C = 0.0;
-  v1->field_350 = 0.0;
-  v1->field_354 = 0.0;
-  for (uint i = 0; i < 16384; ++i)
-  {
-    list_0037C[i].field_0 = 0;
-    list_0037C[i].flt_30 = 0.0f;
-  }
-
-  list_0037C_size = 0;
-  for (uint i = 0; i < 256; ++i)
-    list_E0380[i].mm7__vector_000004_size = 0;
-  /*v10 = v1->list_E0380;
-  v12 = 256;
-  do
-  {
-    v10->mm7__vector_000004_size = 0;
-    //mm7__vector_constructor(
-    //  v10->mm7__vector_000004,
-    //  48,
-    //  64,
-    //  (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1);
-    //++v10;
-    --v12;
-  }
-  while ( v12 );*/
-  list_E0380_size = 0;
-  //v1->vdestructor_ptr = &stru8_pvdtor;
-}
-
-
 //----- (004254D2) --------------------------------------------------------
 int __fastcall sr_4254D2(signed int a1)
 {
@@ -1243,9 +1155,6 @@
   return result;
 }
 
-
-
-
 //----- (004268E3) --------------------------------------------------------
 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor)
 {
@@ -1290,8 +1199,6 @@
 // 50C994: using guessed type int dword_50C994;
 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
 
-
-
 //----- (004269A2) --------------------------------------------------------
 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1)
 {
@@ -1703,7 +1610,6 @@
   return result;
 }
 
-
 //----- (0042704B) --------------------------------------------------------
 bool stru319::special_ability_use_check(Actor *pActor, int a2)
 {
@@ -2160,7 +2066,6 @@
   return result;
 }
 
-
 //----- (00427769) --------------------------------------------------------
 bool __fastcall sub_427769_spell(unsigned int uSpellID)
 {
@@ -2486,8 +2391,6 @@
     }
 }
 
-
-
 //----- (00427D48) --------------------------------------------------------
 void stru277::_427D48(unsigned int uPlayerID)
 {
@@ -7604,15 +7507,12 @@
   return v3;
 }
 
-
-
 //----- (0042EB78) --------------------------------------------------------
 int IconFrameTable::GetIconAnimLength(unsigned int uIconID)
 {
   return 8 * this->pIcons[uIconID].uAnimLength;
 }
 
-
 const wchar_t *UIMessage2String(UIMessageType msg)
 {
   #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b;
@@ -7711,7 +7611,6 @@
   #undef CASE
 }
 
-
 //----- (0042EB8D) --------------------------------------------------------
 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line)
 {
@@ -8106,7 +8005,6 @@
   return 0;
 }
 
-
 //----- (0042F3D6) --------------------------------------------------------
 void InitializeTurnBasedAnimations(void *_this)
 {
@@ -8505,8 +8403,6 @@
   return result;
 }
 
-
-
 //----- (0042FB5C) --------------------------------------------------------
 bool __fastcall sub_42FB5C(signed int a1)
 {
@@ -9133,4 +9029,3 @@
     AsyncKeyboard::LeaveCriticalSection();
   }
 }
-
--- a/mm7_data.cpp	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_data.cpp	Sun Mar 24 09:19:36 2013 +0600
@@ -1496,96 +1496,7 @@
 
 int price_for_membership[11]={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak
 
-stru365_travel_info travel_schedule[25] =
-{
-  {3, {1, 0, 1, 0, 1, 0, 0}, 2, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  {4, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  {0xD, {1, 0, 1, 0, 1, 0, 0}, 2, {0, 0, 0}, 0x127A, 4294956716, 320, 1024, 0},
-  {2, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  {5, {1, 0, 0, 1, 0, 0, 0}, 3, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  {6, {0, 0, 1, 0, 0, 1, 0}, 3, {0, 0, 0}, 0x22DB, 17191, 1, 512, 0},
-  {0xE, {1, 0, 1, 0, 1, 0, 0}, 3, {0, 0, 0}, 0x42A3, 12331, 512, 1152, 0},
-  {5, {0, 1, 0, 0, 1, 0, 1}, 2, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  {2, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  {3, {1, 0, 1, 0, 1, 0, 0}, 3, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  {4, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  {3, {1, 0, 1, 0, 1, 0, 1}, 3, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  {2, {0, 1, 0, 0, 0, 1, 0}, 5, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  {3, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  {4, {0, 1, 0, 1, 0, 1, 0}, 3, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  {5, {0, 0, 1, 0, 0, 0, 1}, 5, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  {0xD, {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF779, 4294960355, 97, 0, 0},
-  {0xE, {1, 0, 0, 0, 1, 0, 0}, 4, {0, 0, 0}, 0x1EE9, 9476, 193, 0, 0},
-  {9, {0, 0, 0, 0, 0, 0, 1}, 7, {0, 0, 0}, 0x3D00, 6390, 193, 1536, 0x40},
-  {6, {0, 0, 1, 0, 0, 0, 0}, 6, {0, 0, 0}, 0x4AE3, 4294947574, 193, 1024, 0},
-  {0xE, {0, 1, 0, 1, 0, 1, 0}, 3, {0, 0, 0}, 0x1EE9, 9476, 193, 0, 0},
-  {6, {1, 0, 1, 0, 0, 0, 0}, 6, {0, 0, 0}, 0x4AE3, 4294947574, 193, 1024, 0},
-  {0xD, {1, 0, 1, 0, 1, 0, 0}, 4, {0, 0, 0}, 0xFFFFF779, 4294960355, 97, 0, 0},
-  {4, {0, 0, 0, 0, 0, 1, 0}, 6, {0, 0, 0}, 0xFFFFFD3B, 4294953209, 193, 1024, 0},
-  {3, {0, 0, 0, 0, 0, 0, 1}, 6, {0, 0, 0}, 0xFFFFD719, 13497, 193, 1536, 0},
-};
-//char byte_4F09B0[777]; // weak
-//char byte_4F09B1[777]; // weak
-//char byte_4F09B8[777]; // weak
-//int dword_4F09CC[192];
 
-unsigned char byte_4F0CD0[30][4] =
-{
-  {  9,   0,   1,   0},  // BildingType_WeaponShop
-  {  1,   0,   0,   0},  // BildingType_ArmorShop
-  {  1,   0,   0,   0},  // BildingType_MagicShop
-  {  0,  61,   0,   0},  // BildingType_AlchemistShop
-  {246,  24,   0,   0},  // BildingType_FireGuild
-  {193,   0,   0,   0},  // BildingType_AirGuild
-  {  0,   6,   0,   0},  // BildingType_WaterGuild
-  { 64,   0,   0,   0},  // BildingType_EarthGuild
-  {  6,   0,   1,   0},  // BildingType_SpiritGuild
-  {  1,   0,   0,   0},  // BildingType_MindGuild
-  {  1,   0,   0,   0},  // BildingType_BodyGuild
-  {227,  74,   0,   0},  // BildingType_LightGuild
-  {246, 178, 255, 255},  // BildingType_DarkGuild
-  {193,   0,   0,   0},  // BildingType_14
-  {  0,   4,   0,   0},  // BildingType_15
-  {  0,   0,   0,   0},  // BildingType_16
-  {  3,   0,   1,   0},  // BildingType_TownHall
-  {  1,   0,   1,   0},  // BildingType_18
-  {  2,   0,   0,   0},  // BildingType_19
-  { 25, 215, 255, 255},  // BildingType_Throne_Room
-  {185,  52,   0,   0},  // BildingType_Tavern
-  {193,   0,   0,   0},  // BildingType_Bank
-  {  0,   6,   0,   0},  // BildingType_Temple
-  {  0,   0,   0,   0},  // BuildingType_24
-  {  6,   1,   0,   1},  // BildingType_Unic
-  {  0,   0,   0,   0},  // BildingType_1A
-  {  4,   0,   0,   0},  // BildingType_Stables
-  {227,  74,   0,   0},  // BildingType_Boats
-  {246, 178, 255, 255},  // BildingType_House
-  {193,   0,   0,   0}   // BildingType_Training
-};
-
-unsigned char byte_4F0E10[20][4] =
-{
-  {  0,   1,   1,  34},
-  {  2,   3,   4,   5},
-  {  6,   7,   8,   8},
-  {  9,  10,  10,  10},
-  { 11,  11,  12,  12},
-  { 13,  13,  13,  13},
-  { 14,  14,  15,  15},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255},
-  { 16,  17,  18,  19},
-  { 18,  20,  21,  21},
-  { 22,  23,  24,  25},
-  { 22,  22,  23,  23},
-  {255, 255, 255, 255},
-  { 27,  28,  29,  30},
-  { 31,  32,  33,  33},
-  { 24,  24,  24,  24},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255}
-};
 Vec2_int_ pMonsterArenaPlacements[20];
 __int16 word_4F0F30[32] ={ 4, 7, 10, 11,                                              
 						   4, 7, 10, 11,
--- a/mm7_data.h	Sun Mar 24 09:18:51 2013 +0600
+++ b/mm7_data.h	Sun Mar 24 09:19:36 2013 +0600
@@ -1011,15 +1011,6 @@
 extern __int16 _4F0882_evt_VAR_PlayerItemInHands_vals[54];
 extern unsigned short pMaxLevelPerTrainingHallType[];
 extern int price_for_membership[]; // weak
-//extern char byte_4F09B0[]; // weak
-//extern char byte_4F09B1[]; // weak
-//extern char byte_4F09B8[]; // weak
-//extern int dword_4F09CC[192];
-//extern char byte_4F0CCF[]; // weak
-extern unsigned char byte_4F0CD0[30][4];
-//extern char _4F0D38_TravelInfo[]; // negindex inside byte_4F0CD0; indexing furthers structs
-//extern int dword_4F0E10[32];
-extern unsigned char byte_4F0E10[20][4];
 extern Vec2_int_ pMonsterArenaPlacements[20];
 extern __int16 word_4F0F30[32]; // weak
 extern char aS03d[]; // idb