changeset 778:64cef5a0782a

Merge
author Nomad
date Sun, 24 Mar 2013 00:33:27 +0200
parents b9f6dd6f1444 (diff) 3dc4a9b13c1b (current diff)
children 2a3fd4d89ec2 b27dd658ea77
files Party.h UIHouses.cpp UIHouses.h mm7_data.cpp mm7_data.h
diffstat 6 files changed, 171 insertions(+), 205 deletions(-) [+]
line wrap: on
line diff
--- a/MapInfo.h	Sun Mar 24 00:50:35 2013 +0400
+++ b/MapInfo.h	Sun Mar 24 00:33:27 2013 +0200
@@ -19,6 +19,8 @@
   MAP_AVLEE = 14,
   MAP_SHOALS = 15,
   //...
+  MAP_ARENA = 76,
+  //...
 };
 
 
--- a/Party.h	Sun Mar 24 00:50:35 2013 +0400
+++ b/Party.h	Sun Mar 24 00:33:27 2013 +0200
@@ -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/UIHouses.cpp	Sun Mar 24 00:50:35 2013 +0400
+++ b/UIHouses.cpp	Sun Mar 24 00:33:27 2013 +0200
@@ -23,6 +23,7 @@
 #include "NPC.h"
 #include "IndoorCamera.h"
 #include "MapInfo.h"
+#include "Log.h"
 
 #include "MM7.h"
 #include "mm7_data.h"
@@ -42,55 +43,82 @@
   unsigned char uMapInfoID;
   unsigned char pSchedule[7];
   unsigned int uTravelTime;
-  int field_C;
-  int field_10;
-  int field_14;
-  int field_18;
+  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 array_4F09B0[35] =
+stru365_travel_info transport_schedule[35] =  // 004F09B0
 {
-   { 3, { 1, 0, 1, 0, 1, 0, 0}, 2, -18048,   4636,  833, 1536, 0},
-   { 4, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2527,  -6773, 1153,  896, 0},
-   {13, { 1, 0, 1, 0, 1, 0, 0}, 2,   4730, -10580,  320, 1024, 0},
-   { 2, { 0, 1, 0, 1, 0, 1, 0}, 2,  -5692,  11137,    1, 1024, 0},
-   { 5, { 1, 0, 0, 1, 0, 0, 0}, 3,   7227, -16007, 2625,  640, 0},
-   { 6, { 0, 0, 1, 0, 0, 1, 0}, 3,   8923,  17191,    1,  512, 0},
-   {14, { 1, 0, 1, 0, 1, 0, 0}, 3,  17059,  12331,  512, 1152, 0},
-   { 5, { 0, 1, 0, 0, 1, 0, 1}, 2,   7227,  16007, 2625,  640, 0},
-   { 2, { 0, 1, 0, 1, 0, 1, 0}, 2,  -5692,  11137,    1, 1024, 0},
-   { 3, { 1, 0, 1, 0, 1, 0, 0}, 3, -18048,   4636,  833, 1536, 0},
-   { 4, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2527,  -6773, 1153,  896, 0},
-   { 3, { 1, 0, 1, 0, 1, 0, 1}, 3, -18048,   4636,  833, 1536, 0},
-   { 2, { 0, 1, 0, 0, 0, 1, 0}, 5,  -5692,  11137,    1, 1024, 0},
-   { 3, { 0, 1, 0, 1, 0, 1, 0}, 2, -18048,   4636,  833, 1536, 0},
-   { 4, { 0, 1, 0, 1, 0, 1, 0}, 3,  -2527,  -6773, 1153,  896, 0},
-   { 5, { 0, 0, 1, 0, 0, 0, 1}, 5,   7227, -16007, 2625,  640, 0},
-   {13, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2183,  -6941,   97,    0, 0},
-   {14, { 1, 0, 0, 0, 1, 0, 0}, 4,   7913,   9476,  193,    0, 0},
-   { 9, { 0, 0, 0, 0, 0, 0, 1}, 7,  15616,   6390,  193, 1536, 0x40},
-   { 6, { 0, 0, 1, 0, 0, 0, 0}, 6,  19171, -19722,  193, 1024, 0},
-   {14, { 0, 1, 0, 1, 0, 1, 0}, 3,   7913,   9476,  193,    0, 0},
-   { 6, { 1, 0, 1, 0, 0, 0, 0}, 6,  19171, -19722,  193, 1024, 0},
-   {13, { 1, 0, 1, 0, 1, 0, 0}, 4,  -2183,  -6941,   97,    0, 0},
-   { 4, { 0, 0, 0, 0, 0, 1, 0}, 6,   -709, -14087,  193, 1024, 0},
-   { 3, { 0, 0, 0, 0, 0, 0, 1}, 6, -10471,  13497,  193, 1536, 0},
-   { 9, { 0, 1, 0, 1, 0, 0, 0}, 1,  15616,   6390,  193, 1536, 0x40},
-   { 6, { 0, 1, 0, 1, 0, 0, 0}, 1,  19171, -19722,  193, 1024, 0},
-   { 3, { 0, 1, 0, 1, 0, 1, 0}, 2, -10471,  13497,  193, 1536, 0},
-   { 6, { 1, 0, 1, 0, 0, 0, 0}, 4,  19171, -19722,  193, 1024, 0},
-   { 9, { 0, 0, 0, 0, 0, 0, 1}, 5,  15616,   6390,  193, 1536, 0x40},
-   {14, { 0, 0, 0, 0, 1, 0, 0}, 5,   7913,   9476,  193,    0, 0},
-   { 3, { 0, 1, 0, 0, 0, 1, 0}, 4, -10471,  13497,  193, 1536, 0},
-   { 4, { 1, 0, 1, 0, 1, 0, 0}, 3,   -709, -14087,  193, 1024, 0},
-   {13, { 0, 0, 0, 1, 0, 0, 0}, 5,  -2183,  -6941,   97,    0, 0},
-   {76, { 0, 0, 0, 0, 0, 0, 1}, 4,   3844,   2906,  193,  512, 0}
+  {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 },
@@ -287,65 +315,8 @@
         {"Human Temple02",              0x24, 0x3AB, 23, 27, 0 },
         {"Player Castle Good",          0x24, 0, 25, 0, 0 },
         {"Player Castle Bad",           0x24, 0, 25, 0, 0}
-    };
+};
 
-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}
-    };
 
 
 //----- (0044606A) --------------------------------------------------------
@@ -739,7 +710,7 @@
   {
 	  if ( in_current_building_type == BildingType_Training )
 	  {
-		if ( uMessageParam == 17 )
+		if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
 		{
 		  v4 = 0;
 		  v5 = 0;
@@ -769,7 +740,7 @@
 	  {
 		  v8 = window_SpeakInHouse;
 		  if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
-			  array_4F09B0[byte_4F0CD0[window_SpeakInHouse->par1C - 1][uMessageParam - 1]].pSchedule[pParty->uDaysPlayed % 7]
+			  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:
@@ -1753,11 +1724,11 @@
   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 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
@@ -1774,7 +1745,7 @@
   GUIButton *v24; // ebx@39
   signed int v25; // eax@41
   //int v26; // esi@44
-  const char *v27; // eax@46
+  //const char *v27; // eax@46
   char *v28; // eax@62
   int v29; // eax@62
   unsigned int v30; // ecx@62
@@ -1795,18 +1766,18 @@
   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
+  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
+  //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
+  //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
@@ -1823,13 +1794,16 @@
   v53.uFrameX = 483;
   v53.uFrameWidth = 148;
   v53.uFrameZ = 334;
-  v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
-  v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
+  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 != 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 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
+
+  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;
@@ -1838,12 +1812,12 @@
     if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
     {
       v16 = pDialogueWindow;
-      v58 = -1;
+      v58 = 255;
       v62 = 0;
       v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
-      v59 = pDialogueWindow;
+      //v59 = pDialogueWindow;
       v54 = v17;
-      strcpy(Dest, "");
+      strcpy(v48[4], "");
       sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
       v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
       v19 = v16->pNumPresenceButton;
@@ -1855,40 +1829,47 @@
       if ( v21 >= v21 + v19 )
         goto LABEL_71;
       s1 = 2;
-      a1 = v48;
+      a1 = (char *)v48;
       while ( 1 )
       {
         int v47 = v60;
         v22 = window_SpeakInHouse->ptr_1C;
-        v23 = byte_4F0E10[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
+        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
-          && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = array_4F09B0[v23].pSchedule[pParty->uDaysPlayed % 7]),
-              v25
-           && (array_4F09B0[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, array_4F09B0[v23].uQuestBit))) )
+
+        if (v23 != v58)
         {
-          v58 = v23;
-          v27 = (const char *)v56;
-          if ( pDialogueWindow->pCurrentPosActiveItem != s1 )
-            v27 = (const char *)v57;
+          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;
-          sprintf(a1, "\f%05d", v27);
-          v66 = array_4F09B0[v23].uTravelTime;
-          if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
+          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;
-            //v47 = Pirate;
             if ( CheckHiredNPCSpeciality(Pirate) )
               v66 -= 2;
           }
           else
           {
-            //v47 = Horseman;
             if ( CheckHiredNPCSpeciality(Horseman) )
               v66 -= 2;
           }
@@ -1898,9 +1879,9 @@
             v66 = 1;
           if ( v23 != v2 )
           {
-            memcpy(&v32, &pMapStats->pInfos[array_4F09B0[v23].uMapInfoID], 0x44u);
+            memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
             sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
-              v66, v32.pName);
+                      v66, v32.pName);
             strcat(a1, pTmpBuf);
             v28 = a1;
             a1 += 100;
@@ -1931,9 +1912,9 @@
           }
         }
         ++v60;
-        if ( (signed int)v60 >= v59->pNumPresenceButton + v59->pStartingPosActiveItem )
+        if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
           break;
-        v16 = v59;
+        //v16 = v59;
       }
       if ( v63 != v55 )
       {
@@ -1943,68 +1924,61 @@
         v45 = (unsigned int)&v49;
         v44 = &v48;
         v43 = pTmpBuf2;*/
-        sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48, v49, v50, v51, Dest);
+        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,
-                          v57, pGlobalTXT_LocalizationStrings[561], 3);
+                          color_default, 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 ( 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);
-        /*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);
+        return;
       }
+
       Party::TakeGold(s1);
-      //v47[1] = (const char *)7;
-      v5 = &array_4F09B0[byte_4F0CD0[window_SpeakInHouse->par1C - 1][dialog_menu_id - 1]];
+
+      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);
-          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;
+          _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 = v10;
-          _5B65B0_npcdata_rep_or_other = v9;
-          dword_5B65C0 = v11 | v10 | v9 | v8;
+          _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
         {
-          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->vPosition.x = v5->arrival_x;
+          pParty->vPosition.y = v5->arrival_y;
+          pParty->vPosition.z = v5->arrival_z;
           pParty->uFallStartY = pParty->vPosition.z;
-          pParty->sRotationY = v5->field_18;
+          pParty->sRotationX = 0;
+          pParty->sRotationY = v5->arrival_rot_y;
         }
         PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
         v12 = v5->uTravelTime;
@@ -2044,15 +2018,7 @@
         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;
-        }*/
+        return;
       }
       else
       {
@@ -2071,29 +2037,16 @@
 //----- (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 (array_4F09B0[idx].pSchedule[pParty->uDaysPlayed % 7])
+    uint route = transport_routes[a1][i];
+    if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
     {
-      if (!array_4F09B0[idx].uQuestBit || _449B57_test_bit(pParty->_quest_bits, array_4F09B0[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 00:50:35 2013 +0400
+++ b/UIHouses.h	Sun Mar 24 00:33:27 2013 +0200
@@ -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_data.cpp	Sun Mar 24 00:50:35 2013 +0400
+++ b/mm7_data.cpp	Sun Mar 24 00:33:27 2013 +0200
@@ -1497,8 +1497,6 @@
 int price_for_membership[11]={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak
 
 
-
-
 Vec2_int_ pMonsterArenaPlacements[20];
 __int16 word_4F0F30[32] ={ 4, 7, 10, 11,                                              
 						   4, 7, 10, 11,
--- a/mm7_data.h	Sun Mar 24 00:50:35 2013 +0400
+++ b/mm7_data.h	Sun Mar 24 00:33:27 2013 +0200
@@ -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