annotate UIHouses.cpp @ 1237:8ee5f1554b64

Слияние
author Ritor1
date Sun, 09 Jun 2013 21:48:48 +0600
parents b237a61e61d3
children 77ea5c5f2c0b
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
4
620
ba08b9403e04 files for houses func
Gloval
parents:
diff changeset
5 #include "UIHouses.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6 #include "Party.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
7 #include "Player.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
8 #include "texts.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
9 #include "Events.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
10 #include "Arcomage.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
11 #include "LOD.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
12 #include "Mouse.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
13 #include "GUIWindow.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
14 #include "GUIFont.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
15 #include "Events2D.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
16 #include "Overlays.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
17 #include "Render.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
18 #include "Indoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
19 #include "Outdoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
20 #include "AudioPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
21 #include "VideoPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
22 #include "Monsters.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
23 #include "Viewport.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
24 #include "Keyboard.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
25 #include "NPC.h"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
26 #include "IndoorCamera.h"
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
27 #include "MapInfo.h"
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
28 #include "Log.h"
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
29 #include "MM7.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
30 #include "mm7_data.h"
978
9334a8c59c8d uGameState
Ritor1
parents: 956
diff changeset
31 #include "Game.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
32
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
33 #include "stru159.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
34 int uHouse_ExitPic; // weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
36 int dword_591080; // weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
37
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
38 int in_current_building_type; // 00F8B198
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
39 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
40
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
41 #pragma pack(push, 1)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
42 struct stru365_travel_info
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
43 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
44 unsigned char uMapInfoID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
45 unsigned char pSchedule[7];
776
3dc4a9b13c1b travel struct fixed
Gloval
parents: 775
diff changeset
46 unsigned int uTravelTime;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
47 int arrival_x;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
48 int arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
49 int arrival_z;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
50 int arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
51 unsigned int uQuestBit; // quest bit required to set for this travel option to be enabled; otherwise 0
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
52 };
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
53 #pragma pack(pop)
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
54 stru365_travel_info transport_schedule[35] = // 004F09B0
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
55 {
778
Nomad
parents: 777 776
diff changeset
56 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
57 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
58 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
Nomad
parents: 777 776
diff changeset
59 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
60 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
61 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
Nomad
parents: 777 776
diff changeset
62 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
Nomad
parents: 777 776
diff changeset
63 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
64 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
65 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
66 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
67 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
68 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
69 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
70 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
71 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
72 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
73 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
74 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 7, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
75 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
76 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
77 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
78 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
79 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
80 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
81 {MAP_EVENMORN_ISLE, {0, 1, 0, 1, 0, 0, 0}, 1, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
82 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
83 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
84 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
85 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 5, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
86 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
87 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
88 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
89 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
90 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
91 };
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
92
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
93 unsigned char transport_routes[20][4] =
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
94 {
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
95 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
96 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
97 { 6, 7, 8, 8}, // HOUSE_STABLES_56
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
98 { 9, 10, 10, 10}, // HOUSE_STABLES_57
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
99 { 11, 11, 12, 12}, // HOUSE_STABLES_58
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
100 { 13, 13, 13, 13}, // HOUSE_STABLES_59
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
101 { 14, 14, 15, 15}, // HOUSE_STABLES_60
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
102 {255, 255, 255, 255}, // HOUSE_STABLES_61
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
103 {255, 255, 255, 255}, // HOUSE_STABLES_62
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
104 {255, 255, 255, 255}, // HOUSE_BOATS_63
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
105 { 16, 17, 18, 19}, // HOUSE_BOATS_64
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
106 { 18, 20, 21, 21}, // HOUSE_BOATS_65
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
107 { 22, 23, 24, 25}, // HOUSE_BOATS_66
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
108 { 22, 22, 23, 23}, // HOUSE_BOATS_67
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
109 {255, 255, 255, 255}, // HOUSE_BOATS_68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
110 { 27, 28, 29, 30}, // HOUSE_BOATS_69
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
111 { 31, 32, 33, 33}, // HOUSE_BOATS_70
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
112 { 24, 24, 24, 24}, // HOUSE_BOATS_71
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
113 {255, 255, 255, 255}, // HOUSE_BOATS_72
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
114 {255, 255, 255, 255} // HOUSE_BOATS_73
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
115 };
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
116
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
117
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
118
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
119
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
120
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1205
diff changeset
121 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1205
diff changeset
122 {{
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
123 {"", 0x4, 0x1F4, 0, 0, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
124 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
125 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
126 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
127 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
128 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
129 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
130 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
131 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
132 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
133 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
134 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
135 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
136 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
137 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
138 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
139 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
140 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
141 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
142 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
143 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
144 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
145 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
146 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
147 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
148 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
149 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
150 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
151 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
152 {"", 0x21, 0x2F0, 27, 91, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
153 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
154 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
155 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
156 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
157 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
158 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
159 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
160 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
161 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
162 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
163 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
164 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
165 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
166 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
167 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
168 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
169 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
170 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
171 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
172 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
173 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
174 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
175 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
176 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
177 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
178 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
179 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
180 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
181 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
182 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
183 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
184 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
185 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
186 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
187 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
188 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
189 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
190 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
191 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
192 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
193 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
194 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
195 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
196 {"Human Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
197 {"Human Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
198 {"Human Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
199 {"Human Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
200 {"Human Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
201 {"Human Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
202 {"Human Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
203 {"Human Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
204 {"Human Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
205 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
206 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
207 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
208 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
209 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
210 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
211 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
212 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
213 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
214 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
215 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
216 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
217 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
218 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
219 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
220 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
221 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
222 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
223 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
224 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
225 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
226 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
227 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
228 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
229 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
230 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
231 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
232 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
233 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
234 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
235 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
236 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
237 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
238 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
239 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
240 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
241 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
242 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
243 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
244 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
245 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
246 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
247 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
248 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
249 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
250 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
251 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
252 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
253 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
254 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
255 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
256 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
257 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
258 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
259 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
260 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
261 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
262 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
263 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
264 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
265 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
266 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
267 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
268 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
269 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
270 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
271 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
272 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
273 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
274 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
275 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
276 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
277 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
278 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
279 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
280 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
281 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
282 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
283 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
284 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
285 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
286 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
287 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
288 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
289 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
290 {"Jail", 0x24, 0, 31, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
291 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
292 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
293 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
294 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
295 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
296 {"Master Thief", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
297 {"Dwarven King", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
298 {"Arms Master", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
299 {"Warlock", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
300 {"Lord Markam", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
301 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
302 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
303 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
304 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
305 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
306 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
307 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
308 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
309 {"Boat01", 0xF, 0, 29, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
310 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
311 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
312 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
313 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
314 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
315 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
316 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
317 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
318 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1205
diff changeset
319 }};
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
320
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
321
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
322
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
323 //----- (0044606A) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
324 void PrepareHouse(HOUSE_ID house)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
325 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
326 //unsigned int v1; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
327 //signed int v2; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
328 //int uExitPic; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
329 __int16 uExitMapID; // ax@2
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
330 //int result; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
331 //unsigned int *v6; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
332 int v7; // ebx@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
333 //int v8; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
334 //unsigned int v9; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
335 //unsigned int v10; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
336 //int v11; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
337 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
338 int v13; // [sp+30h] [bp-30h]@11
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
339 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
340 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
341 int uAnimationID; // [sp+50h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
342 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
343 //unsigned int v18; // [sp+58h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
344 //int v19; // [sp+5Ch] [bp-4h]@7
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
345
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
346
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
347 uAnimationID = p2DEvents[house - 1].uAnimationID;
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
348 memset(npc_id_arr, 0, sizeof(npc_id_arr));
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
349 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
350 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
351 if ( uHouse_ExitPic )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
352 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
353 uExitMapID = p2DEvents[house - 1]._quest_related;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
354 if ( uExitMapID > 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
355 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
356 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
357 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
358 uHouse_ExitPic = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
359 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
360 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
361 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
362
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
363 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id;
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
364 HouseNPCData[0]=0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
365 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
366 if ( dword_591080 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
367 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
368
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
369 npc_id_arr[0] = dword_591080;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
370 uNumDialogueNPCPortraits = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
371 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
372
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
373 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
374 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
375 if (pNPCStats->pNewNPCData[i].Location2D == house )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
376 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
377 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80))
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
378 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
379
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
380 HouseNPCData[uNumDialogueNPCPortraits+1- (dword_591080 != 0) ? 1 : 0] = &pNPCStats->pNewNPCData[i];
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
381 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID;
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
382 ++uNumDialogueNPCPortraits;
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
383 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2)
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
384 ++pNPCStats->pNewNPCData[i].uFlags;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
385 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
386 }
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
387
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
388 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
389
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
390 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
391 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
392
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
393 char icon_name[128];
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
394 sprintfex(icon_name, "npc%03u", npc_id_arr[i]);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
395 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
396 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
397
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
398 if (uHouse_ExitPic)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
399 {
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
400 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
401 ++uNumDialogueNPCPortraits;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
402 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
403 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
404 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
405
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
406
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
407 //----- (0044622E) --------------------------------------------------------
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
408 bool EnterHouse(enum HOUSE_ID uHouseID)
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
409 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
410 //enum HOUSE_ID v1; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
411 //int v2; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
412 signed int uOpenTime; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
413 signed int uCloseTime; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
414 unsigned int v5; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
415 int v6; // edx@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
416 signed int am_pm_flag_open; // ecx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
417 signed int am_pm_flag_close; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
418 int v9; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
419 //unsigned int v10; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
420 int v11; // ecx@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
421 unsigned int v12; // kr00_4@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
422 //Player *v13; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
423 int v14; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
424 //Player *v15; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
425 //signed int v16; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
426 unsigned int v17; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
427 signed int v18; // edi@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
428 signed int v19; // edi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
429 //unsigned int v20; // ecx@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
430 //const char *v22; // [sp-4h] [bp-40h]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
431 char pContainer[40]; // [sp+Ch] [bp-30h]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
432 unsigned int v24; // [sp+34h] [bp-8h]@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
433 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
434
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
435 //v1 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
436 //v25 = uHouseID;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 778
diff changeset
437 GameUI_Footer_TimedString[0] = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 778
diff changeset
438 pFooterString[0] = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
439 ShowStatusBarString("", 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
440 if ( pMessageQueue_50CBD0->uNumMessages )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
441 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
442 viewparams->bRedrawGameUI = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
443 uDialogueType = 0;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
444 pKeyActionMap->SetWindowInputStatus(3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
445 pKeyActionMap->ResetKeys();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
446 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
447 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
448 GameOverMenu(0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
449 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
450 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
451 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
452 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
453 current_npc_text = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
454 dword_F8B1E4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
455 dword_F8B1F4 = 0;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
456 memset(byte_F8B1F0.data(), 0, 4);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
457 memset(player_levels.data(), 0, 16);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
458 pRenderer->ClearZBuffer(0, 479);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
459
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
460 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
461 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
463 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
464 am_pm_flag_open = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
465 am_pm_flag_close = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
466 if (uOpenTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
467 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
468 uOpenTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
469 am_pm_flag_open = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
470 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
471 if ( uCloseTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
472 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
473 uCloseTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
474 am_pm_flag_close = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
475 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
476 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
477 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
478 ShowStatusBarString(pTmpBuf.data(), 2u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
479 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
480 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
481 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
482 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
483 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
484 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
485 //v10 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
486 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
487 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
488 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
489 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
490 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
491 pParty->field_3C._shop_ban_times[uHouseID] = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
492 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
493 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
494 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
495 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
496 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
497 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
498 }
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
499 pAudioPlayer->StopChannels(-1, -1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
500
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
501 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
502 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
503 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
504 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
505 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
506 uHouseID = HOUSE_JAIL;
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
507 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
508 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
509 ++pParty->uNumPrisonTerms;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
510 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
511 for (uint i = 0; i < 4; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
512 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
513 pParty->pPlayers[i].uTimeToRecovery = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
514 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
515 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
516 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
517 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
518 ++pIcons_LOD->uTexturePacksCount;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
519 if ( !pIcons_LOD->uNumPrevLoadedFiles )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
520 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
521 switch (pParty->alignment)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
522 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
523 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
524 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
525 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
526 default: assert(false);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
527 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
528
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
529 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
530 pDialogueNPCCount = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
531 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
910
Ritor1
parents: 907
diff changeset
532 uTextureID_right_panel_loop = uTextureID_right_panel;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
533 PrepareHouse(uHouseID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
534 v18 = 1;
910
Ritor1
parents: 907
diff changeset
535 uTextureID_right_panel_loop = uTextureID_right_panel;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
536 if ( uNumDialogueNPCPortraits == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
537 pDialogueNPCCount = 1;
898
10fa7dad1391 DrawPaperdoll clean
Ritor1
parents: 893
diff changeset
538 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
539 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
540 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
541 {
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
542 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
543 {
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
544 return 1;
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
545 }
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
546 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
547 else
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
548 { //guilds
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
549 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
550 //v20 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
551 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
552 if(_449B57_test_bit(pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
553 {
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
554 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
555 return 1;
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
556 }
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
557 }
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
558 PlayHouseSound(uHouseID, HouseSound_Greeting);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
559 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
560 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
561 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
562 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
563
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
564 //----- (004B1E92) --------------------------------------------------------
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
565 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
566 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
567 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
568 if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
569 pAudioPlayer->PlaySound(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
570 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
571 (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId + 300)),
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
572 806, 0, -1, 0, 0, 0, 0);
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
573 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
574
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
575 //----- (004B4F4F) --------------------------------------------------------
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
576 void JailDialog()
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
577 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
578 const char *v0; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
579 const char *v1; // ST10_4@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
580 unsigned __int16 v2; // ST0C_2@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
581 int v3; // eax@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
582 GUIWindow v5; // [sp+8h] [bp-54h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
583
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
584 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
585 v0 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
586 v1 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
587 v5.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
588 v5.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
589 v5.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
590 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
591 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
592 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
593 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
594
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
595
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
596
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
597
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
598 //----- (004BCACC) --------------------------------------------------------
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
599 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
600 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
601 //unsigned int v1; // edi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
602 //signed int v2; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
603 //signed int v3; // ecx@2
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
604 int v4; // eax@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
605 signed int v5; // esi@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
606 //Player *v6; // ecx@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
607 //signed int v7; // edx@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
608 GUIWindow *v8; // esi@10
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
609 unsigned int v9; // eax@12
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
610 int v10; // esi@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
611 int v11; // edi@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
612 int v12; // esi@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
613 __int16 v13; // bp@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
614 int v14; // edx@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
615 GUIWindow *v15; // eax@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
616 int v16; // eax@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
617 int v17; // eax@33
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
618 int v18; // eax@34
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
619 int v19; // eax@35
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
620 __int16 v20; // ax@37
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
621 __int16 v21; // ax@76
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
622 __int16 v22; // ax@107
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
623 __int16 v23; // ax@132
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
624 __int16 v24; // ax@163
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
625 int v25; // esi@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
626 __int16 v26; // ax@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
627 char v27; // zf@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
628 Player *v28; // edi@192
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
629 int v29; // eax@204
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
630 void *v30; // esi@208
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
631 unsigned __int64 v31; // qax@208
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
632 signed int v32; // edi@209
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
633 int v33; // eax@210
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
634 unsigned int v34; // eax@211
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
635 //Player *v35; // edi@227
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
636 signed int v36; // esi@227
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
637 int v37; // ecx@227
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
638 int v38; // esi@230
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
639 int v39; // edx@235
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
640 int v40; // edi@243
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
641 unsigned __int64 v41; // qax@243
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
642 //void *v42; // eax@244
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
643 signed int v43; // edi@244
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
644 int v44; // edx@244
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
645 int v45; // eax@246
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
646 unsigned int v46; // eax@247
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
647 void *v47; // eax@250
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
648 signed int v48; // edi@250
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
649 int v49; // eax@252
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
650 int v50; // eax@256
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
651 unsigned int v51; // eax@257
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
652 void *v52; // eax@260
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
653 signed int v53; // edi@260
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
654 int v54; // eax@262
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
655 //signed int v55; // [sp+10h] [bp-10h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
656 int v56; // [sp+14h] [bp-Ch]@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
657
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
658 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
659 //v2 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
660 //v55 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
661 if ( !pDialogueWindow->pNumPresenceButton )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
662 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
663 pRenderer->ClearZBuffer(0, 479);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
664 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
665 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
666 v8 = window_SpeakInHouse;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
667 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
668 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
669 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
670 if ( in_current_building_type == BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
671 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
672 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
673 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
674 v4 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
675 v5 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
676 //v6 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
677 //v7 = pPlayers[uActiveCharacter]->uLevel;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
678 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
679 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
680 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
681 v4 += v5++ + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
682 while ( v5 < pPlayers[uActiveCharacter]->uLevel );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
683 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
684 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
685 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
686 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
687 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
688 pDialogueWindow->Release();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
689 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
690 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
691 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
692 pDialogueWindow->CreateButton(8, 8, 0x1C2, 0x140, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
693 // LABEL_10:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
694 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
695 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
696 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
697 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
698 if ( in_current_building_type != BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
699 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
700 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
701 if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
702 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
703 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
704 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
705 //LABEL_9:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
706 pDialogueWindow->Release();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
707 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
708 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
709 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
710 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
711 // LABEL_10:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
712 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
713 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
714 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
715 else if (uActiveCharacter)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
716 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
717 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
718 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
719 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
720 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
721 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
722 //LABEL_11:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
723 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
724 if ( in_current_building_type < BildingType_19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
725 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
726 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
727 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
728 ShopTexture = &pIcons_LOD->pTextures[v9];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
729 //LABEL_13:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
730 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
731 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
732 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
733
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
734 //NEW
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
735 switch(in_current_building_type)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
736 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
737 case BildingType_FireGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
738 case BildingType_AirGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
739 case BildingType_WaterGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
740 case BildingType_EarthGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
741 case BildingType_SpiritGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
742 case BildingType_MindGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
743 case BildingType_BodyGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
744 case BildingType_LightGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
745 case BildingType_DarkGuild:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
746 case BildingType_14:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
747 case BildingType_15:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
748 case BildingType_16:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
749 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
750 if ( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472] >= (signed __int64)pParty->uTimePlayed &&
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
751 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468] >= (signed __int64)pParty->uTimePlayed )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
752 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
753 v32 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
754 do
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
755 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
756 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
757 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
758 if ( v33 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
759 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
760 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
761 v8 = window_SpeakInHouse;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
762 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
763 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
764 ++v32;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
765 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
766 while ( v32 < 12 );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
767 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
768 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
769 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
770 SpellBookGenerator();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
771 v30 = window_SpeakInHouse->ptr_1C;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
772 v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
773 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
774 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
775 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
776 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
777 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
778 //return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
779 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
780 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
781 case BildingType_TownHall:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
782 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
783 if ( uMessageParam == 99 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
784 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
785 v10 = (int)((char *)v8->ptr_1C - 102);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
786 v56 = v10;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
787 v11 = 8 * v10 + 11325428;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
788 if ( pParty->field_3C.field_0[2 * v10 + 1] >= (signed __int64)pParty->uTimePlayed
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
789 && pParty->field_3C.field_0[2 * v10] >= (signed __int64)pParty->uTimePlayed )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
790 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
791 v13 = 0;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
792 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
793 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
794 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
795 v12 = v10;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
796 v13 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
797 pParty->field_75A[v12] = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
798 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
799 v14 = rand() % 258;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
800 v15 = window_SpeakInHouse;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
801 pParty->field_750[v12] = v14 + 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
802 v16 = (int)((char *)v15->ptr_1C - 102);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
803 if ( v16 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
804 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
805 v17 = v16 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
806 if ( v17 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
807 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
808 v18 = v17 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
809 if ( v18 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
810 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
811 v19 = v18 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
812 if ( v19 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
813 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
814 if ( v19 == 1 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
815 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
816 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
817 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
818 v20 = pParty->field_750[v12];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
819 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
820 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
821 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
822 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
823 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
824 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
825 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
826 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
827 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
828 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
829 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
830 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
831 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
832 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
833 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
834 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
835 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
836 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
837 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
838 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
839 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
840 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
841 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
842 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
843 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
844 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
845 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
846 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
847 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
848 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
849 v21 = pParty->field_750[v12];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
850 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
851 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
852 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
853 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
854 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
855 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
856 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
857 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
858 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
859 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
860 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
861 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
862 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
863 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
864 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
865 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
866 break;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
867 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
868 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
869 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
870 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
871 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
872 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
873 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
874 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
875 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
876 v22 = pParty->field_750[v12];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
877 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
878 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
879 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
880 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
881 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
882 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
883 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
884 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
885 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
886 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
887 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
888 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
889 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
890 break;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
891 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
892 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
893 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
894 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
895 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
896 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
897 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
898 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
899 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
900 v23 = pParty->field_750[v12];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
901 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
902 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
903 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
904 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
905 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
906 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
907 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
908 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
909 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
910 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
911 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
912 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
913 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
914 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
915 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
916 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
917 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
918 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
919 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
920 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
921 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
922 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
923 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
924 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
925 while ( 1 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
926 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
927 v24 = pParty->field_750[v12];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
928 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
929 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
930 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
931 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
932 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
933 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
934 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
935 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
936 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
937 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
938 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
939 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
940 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
941 break;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
942 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
943 pParty->field_750[v12] = rand() % 258 + 1;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
944 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
945 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
946 v10 = v56;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
947 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
948 v25 = v10;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
949 v26 = pParty->field_750[v25];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
950 v27 = pParty->field_75A[v25] == v13;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
951 word_F8B1A0 = pParty->field_750[v25];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
952 if ( v27 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
953 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
954 //v1 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
955 v27 = v26 == v13;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
956 v29 = (int)pNPCTopics[351].pText;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
957 if ( v27 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
958 v29 = (int)pNPCTopics[353].pText;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
959 dword_F8B1A4 = (char *)v29;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
960 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
961 else
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
962 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
963 if ( v26 != v13 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
964 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
965 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
966 v28 = pParty->pPlayers;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
967 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
968 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
969 v28->SetVariable(VAR_Award, 86);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
970 ++v28;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
971 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
972 while ( (signed int)v28 < (signed int)pParty->pHirelings );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
973 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
974 pParty->field_750[v25] = v13;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
975 pParty->field_75A[v25] = v13;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
976 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
977 //v1 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
978 dword_F8B1A4 = pNPCTopics[352].pText;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
979 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
980 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
981 else if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_100 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
982 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
983 pKeyActionMap->EnterText(1, 10, v8);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
984 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
985 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
986 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
987 case BildingType_Bank:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
988 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
989 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
990 pKeyActionMap->EnterText(1, 10, v8);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
991 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
992 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
993 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
994 case BildingType_WeaponShop:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
995 case BildingType_ArmorShop:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
996 case BildingType_MagicShop:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
997 case BildingType_AlchemistShop:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
998 case BildingType_Tavern:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
999 case BildingType_Temple:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1000 case BildingType_Training:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1001 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1002 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1003 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1004 default:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1005 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1006 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1007 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1008 }
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1009 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1010
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1011 /*
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1012 if ( in_current_building_type > BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1013 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1014 if ( in_current_building_type == BildingType_Bank )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1015 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1016 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1017 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1018 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1019 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1020 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1021 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1022 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1023 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1024 if ( in_current_building_type < BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1025 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1026 if (in_current_building_type <= 0)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1027 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1028 if ( in_current_building_type > BildingType_AlchemistShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1029 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1030 if ( in_current_building_type <= BildingType_16 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1031 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1032 if ( (signed __int64)__PAIR__(
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1033 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1034 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1035 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1036 v32 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1037 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1038 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1039 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1040 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1041 if ( v33 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1042 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1043 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1044 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1045 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1046 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1047 ++v32;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1048 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1049 while ( v32 < 12 );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1050 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1051 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1052 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1053 SpellBookGenerator();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1054 v30 = window_SpeakInHouse->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1055 v31 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1056 + (signed __int64)((double)(0xA8C000
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1057 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1058 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1059 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1060 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1061 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1062 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1063 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1064 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1065 if ( in_current_building_type != BildingType_TownHall )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1066 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1067 if ( in_current_building_type == BildingType_TownHall )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1068 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1069 if ( uMessageParam == 99 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1070 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1071 v10 = (int)((char *)v8->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1072 v56 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1073 v11 = 8 * v10 + 11325428;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1074 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1075 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1076 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1077 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1078 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1079 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1080 v12 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1081 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1082 pParty->field_75A[v12] = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1083 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1084 v14 = rand() % 258;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1085 v15 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1086 pParty->field_750[v12] = v14 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1087 v16 = (int)((char *)v15->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1088 if ( v16 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1089 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1090 v17 = v16 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1091 if ( v17 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1092 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1093 v18 = v17 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1094 if ( v18 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1095 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1096 v19 = v18 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1097 if ( v19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1098 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1099 if ( v19 == 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1100 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1101 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1102 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1103 v20 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1104 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1105 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1106 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1107 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1108 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1109 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1110 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1111 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1112 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1113 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1114 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1115 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1116 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1117 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1118 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1119 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1120 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1121 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1122 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1123 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1124 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1125 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1126 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1127 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1128 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1129 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1130 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1131 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1132 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1133 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1134 v21 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1135 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1136 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1137 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1138 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1139 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1140 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1141 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1142 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1143 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1144 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1145 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1146 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1147 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1148 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1149 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1150 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1151 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1152 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1153 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1154 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1155 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1156 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1157 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1158 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1159 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1160 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1161 v22 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1162 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1163 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1164 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1165 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1166 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1167 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1168 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1169 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1170 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1171 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1172 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1173 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1174 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1175 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1176 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1177 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1178 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1179 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1180 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1181 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1182 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1183 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1184 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1185 v23 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1186 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1187 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1188 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1189 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1190 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1191 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1192 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1193 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1194 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1195 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1196 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1197 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1198 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1199 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1200 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1201 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1202 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1203 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1204 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1205 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1206 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1207 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1208 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1209 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1210 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1211 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1212 v24 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1213 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1214 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1215 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1216 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1217 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1218 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1219 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1220 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1221 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1222 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1223 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1224 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1225 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1226 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1227 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1228 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1229 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1230 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1231 v10 = v56;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1232 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1233 v25 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1234 v26 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1235 v27 = pParty->field_75A[v25] == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1236 word_F8B1A0 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1237 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1238 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1239 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1240 v27 = v26 == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1241 v29 = (int)pNPCTopics[351].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1242 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1243 v29 = (int)pNPCTopics[353].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1244 dword_F8B1A4 = (char *)v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1245 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1246 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1247 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1248 if ( v26 != v13 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1249 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1250 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1251 v28 = pParty->pPlayers;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1252 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1253 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1254 v28->SetVariable(VAR_Award, 86);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1255 ++v28;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1256 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1257 while ( (signed int)v28 < (signed int)pParty->pHirelings );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1258 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1259 pParty->field_750[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1260 pParty->field_75A[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1261 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1262 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1263 dword_F8B1A4 = pNPCTopics[352].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1264 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1265 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1266 else if ( uMessageParam == 100 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1267 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1268 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1269 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1270 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1271 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1272 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1273 */
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1274
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1275
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1276 //LABEL_196:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1277 switch ( uMessageParam )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1278 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1279 case HOUSE_DIALOGUE_LEARN_SKILLS:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1280 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1281 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1282 UI_CreateEndConversationButton();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1283 FillAviableSkillsToTeach(in_current_building_type);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1284 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1285 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1286 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1287 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1288 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1289 UI_CreateEndConversationButton();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1290 sub_4B3A72(in_current_building_type);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1291 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1292 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1293 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1294 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1295 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1296 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1297 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1298 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1299 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1300 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1301 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1302 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 984
diff changeset
1303 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_PlayArcomage;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1304 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1305 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1306 ++pMessageQueue_50CBD0->uNumMessages;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1307 }*/
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1308 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1309 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1310 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1311 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1312 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1313 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1314 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1315 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1316 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1317 GenerateStandartShopItems();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1318 GenerateSpecialShopItems();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1319 pParty->field_3C.field_50[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1320 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1321 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1322 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1323 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1324 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1325 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1326 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1327 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1328 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1329 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1330 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1331 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1332 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1333 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1334 if ( in_current_building_type == BildingType_WeaponShop )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1335 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1336 v48 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1337 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1338 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1339 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1340 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1341 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v48].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1342 word_F8B158[v48] = rand() % (300 - ItemsInShopTexture[v48]->uTextureHeight);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1343 ++v48;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1344 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1345 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1346 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1347 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1348 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1349 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1350 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1351 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1352 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1353 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1354 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1355 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1356 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1357 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1358 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1359 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1360 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1361 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1362 if ( in_current_building_type == BildingType_WeaponShop )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1363 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1364 v53 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1365 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1366 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1367 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1368 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1369 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v53].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1370 word_F8B158[v53] = rand() % (300 - ItemsInShopTexture[v53]->uTextureHeight);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1371 ++v53;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1372 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1373 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType ] );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1374 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1375 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1376 }
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1377 break;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1378 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1379 case HOUSE_DIALOGUE_SHOP_SELL:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1380 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1381 case HOUSE_DIALOGUE_SHOP_REPAIR:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1382 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1383 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1385 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1386 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1387 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1388 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1389 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1390 UI_CreateEndConversationButton();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1391 sub_4B3AD4(in_current_building_type);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1392 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1393 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1394 default:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1395 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1396 if( uMessageParam >= HOUSE_DIALOGUE_36 && uMessageParam <= HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1397 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1398 //v35 = pPlayers[uActiveCharacter];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1399 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1400 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1401 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1402 if ( v37 < v36 / 3 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1403 v37 = v36 / 3;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1404 //if (false)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1405 if(byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][uMessageParam-36])
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1406 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1407 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1408 //v38 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + uMessageParam);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1409 if ( !pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1410 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1411 if ( pParty->uNumGold < v37 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1412 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1413 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1414 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1415 v39 = 4;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1416 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1417 v39 = 2;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1418 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1419 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1420 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1421 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1422 Party::TakeGold(v37);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1423 dword_F8B1E4 = 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1424 pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] = 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1425 pPlayers[uActiveCharacter]->PlaySound(SPEECH_78, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1426 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1427 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1428 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1429 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1430 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
1431 }
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1432 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1433 /*
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1434 if ( uMessageParam != 95 && uMessageParam != 2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1435 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1436 if ( uMessageParam == 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1437 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1438 dialog_menu_id = 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1439 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1440 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1441 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1442 if ( uMessageParam == 4 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1443 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1444 dialog_menu_id = 4;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1445 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1446 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1447 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1448 if ( uMessageParam != 5 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1449 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1450 if ( uMessageParam > 35 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1451 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1452 if ( uMessageParam <= 72 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1453 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1454 v35 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1455 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1456 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1457 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1458 if ( v37 < v36 / 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1459 v37 = v36 / 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1460
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1461 __debugbreak();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1462 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1463 // or
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1464 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1465 // or
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1466 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1467
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1468 if (false)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1469 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1470 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1471 v38 = (int)(&v35->uIntelligence + uMessageParam);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1472 if ( !*(short *)v38 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1473 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1474 if ( pParty->uNumGold < v37 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1475 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1476 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1477 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1478 v39 = 4;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1479 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1480 v39 = 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1481 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1482 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1483 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1484 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1485 Party::TakeGold(v37);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1486 dword_F8B1E4 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1487 *(short *)v38 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1488 v35->PlaySound(SPEECH_78, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1489 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1490 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1491 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1492 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1493 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1494 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1495 if ( uMessageParam == 94 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1496 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1497 pDialogueWindow->eWindowType = WINDOW_MainMenu;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1498 UI_CreateEndConversationButton();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1499 sub_4B3AD4(in_current_building_type);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1500 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1501 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1502 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1503 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1504 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1505 dialog_menu_id = 5;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1506 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1507 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1508 sub_421B2C_PlaceInInventory_or_DropPickedItem();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1509 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1510 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1511 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1512 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1513 GenerateStandartShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1514 GenerateSpecialShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1515 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1516 v40 = window_SpeakInHouse->par1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1517 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1518 v41 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1519 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1520 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1521 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1522 pParty->field_3C.field_50[v40] = v41;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1523
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1524 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1525 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1526 v43 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1527 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1528 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1529 if ( uMessageParam == 2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1530 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1531 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1532 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1533 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1534 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1535 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1536 if ( v45 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1537 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1538 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1539 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1540 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1541 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1542 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1543 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1544 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1545 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1546 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1547 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1548 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1549 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1550 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1551 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1552 v48 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1553 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1554 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1555 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1556 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1557 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1558 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1559 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1560 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1561 v49 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1562 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1563 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1564 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1565 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1566 ++v48;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1567 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1568 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1569 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1570 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1571 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1572 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1573 if ( uMessageParam == 95 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1574 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1575 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1576 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1577 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1578 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1579 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1580 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1581 if ( v50 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1582 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1583 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1584 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1585 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1586 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1587 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1588 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1589 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1590 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1591 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1592 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1593 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1594 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1595 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1596 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1597 v53 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1598 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1599 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1600 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1601 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1602 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1603 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1604 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1605 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1606 v54 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1607 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1608 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1609 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1610 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1611 ++v53;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1612 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1613 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1614 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1615 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1616 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1617 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1618 */
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1619 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1620
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1621
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1622
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1623 //----- (004B6943) --------------------------------------------------------
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1624 void __cdecl TravelByTransport()
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1625 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1626 GUIWindow *v0; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1627 Player *v1; // esi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1628 signed int v2; // edi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1629 unsigned int v3; // eax@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1630 signed int v4; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1631 stru365_travel_info *v5; // esi@7
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1632 //int v6; // eax@9
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1633 //int v7; // eax@9
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1634 //int v8; // eax@12
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1635 //int v9; // edi@12
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1636 //int v10; // edx@12
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1637 int v11; // ecx@12
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1638 signed int v12; // esi@13
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1639 signed int v13; // edi@14
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1640 DWORD v14; // eax@26
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1641 DWORD v15; // edi@26
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1642 GUIWindow *v16; // ebx@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1643 int v17; // esi@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1644 int v18; // eax@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1645 int v19; // ecx@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1646 int v20; // esi@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1647 int v21; // eax@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1648 void *v22; // eax@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1649 int v23; // esi@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1650 GUIButton *v24; // ebx@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1651 signed int v25; // eax@41
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1652 //int v26; // esi@44
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1653 //const char *v27; // eax@46
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1654 char *v28; // eax@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1655 int v29; // eax@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1656 unsigned int v30; // ecx@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1657 char *v31; // eax@63
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1658 MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1659 /*int v33; // [sp-38h] [bp-2C8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1660 int v34; // [sp-34h] [bp-2C4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1661 int v35; // [sp-30h] [bp-2C0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1662 int v36; // [sp-2Ch] [bp-2BCh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1663 int v37; // [sp-28h] [bp-2B8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1664 int v38; // [sp-24h] [bp-2B4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1665 int v39; // [sp-20h] [bp-2B0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1666 int v40; // [sp-1Ch] [bp-2ACh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1667 int v41; // [sp-18h] [bp-2A8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1668 int v42; // [sp-14h] [bp-2A4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1669 char *v43; // [sp-10h] [bp-2A0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1670 char *v44; // [sp-Ch] [bp-29Ch]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1671 unsigned int v45; // [sp-8h] [bp-298h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1672 char *v46; // [sp-4h] [bp-294h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1673 const char *v47[5]; // [sp+0h] [bp-290h]@7*/
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1674 char v48[5][100]; // [sp+14h] [bp-27Ch]@37
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1675 //char v49[100]; // [sp+78h] [bp-218h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1676 //char v50[100]; // [sp+DCh] [bp-1B4h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1677 //char v51[100]; // [sp+140h] [bp-150h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1678 //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1679 GUIWindow v53; // [sp+208h] [bp-88h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1680 int v54; // [sp+25Ch] [bp-34h]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1681 int v55; // [sp+260h] [bp-30h]@36
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1682 //unsigned int v56; // [sp+264h] [bp-2Ch]@1
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1683 //int v57; // [sp+268h] [bp-28h]@1
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1684 int v58; // [sp+26Ch] [bp-24h]@36
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1685 //GUIWindow *v59; // [sp+270h] [bp-20h]@1
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1686 unsigned int v60; // [sp+274h] [bp-1Ch]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1687 //Player *v61; // [sp+278h] [bp-18h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1688 int v62; // [sp+27Ch] [bp-14h]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1689 int v63; // [sp+280h] [bp-10h]@14
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1690 char *a1; // [sp+284h] [bp-Ch]@37
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1691 unsigned int s1; // [sp+288h] [bp-8h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1692 int v66; // [sp+28Ch] [bp-4h]@48
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1693
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1694 v0 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1695 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1696 v2 = 255;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1697 //v61 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1698 v1 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1699 v53.uFrameX = 483;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1700 v53.uFrameWidth = 148;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1701 v53.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
1702 auto color_default = TargetColor(255, 255, 255);
Nomad
parents: 948
diff changeset
1703 auto color_selected = TargetColor(255, 255, 155);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1704 v3 = 52 * (unsigned int)v0->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1705 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1706 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1707 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1708
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1709 v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1710 v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1711
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1712 s1 = v4 * (100 - v1->GetMerchant()) / 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1713 if ( (signed int)s1 < v4 / 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1714 s1 = v4 / 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1715 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1716 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1717 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1718 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1719 v16 = pDialogueWindow;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1720 v58 = 255;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1721 v62 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1722 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1723 //v59 = pDialogueWindow;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1724 v54 = v17;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1725 strcpy(v48[4], "");
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1726 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1727 v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1728 v19 = v16->pNumPresenceButton;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1729 v20 = v18 + v17 + 146;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1730 v21 = v16->pStartingPosActiveItem;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1731 v63 = v20;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1732 v55 = v20;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1733 v60 = v21;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1734 if ( v21 >= v21 + v19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1735 goto LABEL_71;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1736 s1 = 2;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1737 a1 = (char *)v48;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1738 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1739 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1740 int v47 = v60;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1741 v22 = window_SpeakInHouse->ptr_1C;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1742 v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1743 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1744 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1745 v24 = v16->GetControl(v60);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1746
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1747 if (v23 != v58)
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1748 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1749 if (v23 >= 25)
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1750 Log::Warning(L"Transport UI: scedule overflow");
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1751 if (s1 >= 6)
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1752 v25 = true;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1753 else
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1754 v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1755 }
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1756
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1757 if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1758 {
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1759 v58 = v23;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1760 if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1761 sprintf(a1, "\f%05d", color_selected);
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1762 else
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1763 sprintf(a1, "\f%05d", color_default);
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1764
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1765 //v32.uRedbookTrackID = v27;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1766 v66 = transport_schedule[v23].uTravelTime;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1767 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1768 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1769 if ( CheckHiredNPCSpeciality(Sailor) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1770 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1771 if ( CheckHiredNPCSpeciality(Navigator) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1772 v66 -= 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1773 if ( CheckHiredNPCSpeciality(Pirate) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1774 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1775 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1776 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1777 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1778 if ( CheckHiredNPCSpeciality(Horseman) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1779 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1780 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1781 if ( CheckHiredNPCSpeciality(Explorer) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1782 --v66;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1783 if ( v66 < 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1784 v66 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1785 if ( v23 != v2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1786 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1787 memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1788 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1789 v66, v32.pName);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1790 strcat(a1, pTmpBuf.data());
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1791 v28 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1792 a1 += 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1793 ++v62;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1794 ++s1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1795 strcat(v28, "\n \n");
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1796 v24->uY = v63;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1797 v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1798 v30 = v24->uY;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1799 v24->uHeight = v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1800 v2 = 255;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1801 v24->uW = v30 + v29 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1802 v63 += v54 + v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1803 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1804 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1805 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1806 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1807 v31 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1808 ++v62;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1809 ++s1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1810 a1 += 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1811 strcpy(v31, "");
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1812 if ( v24 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1813 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1814 v24->uW = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1815 v24->uHeight = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1816 v24->uY = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1817 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1818 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1819 ++v60;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1820 if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1821 break;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1822 //v16 = v59;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1823 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1824 if ( v63 != v55 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1825 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1826 /*v47[1] = &Dest;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1827 v47[0] = &v51;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1828 v46 = &v50;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1829 v45 = (unsigned int)&v49;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1830 v44 = &v48;
1217
b237a61e61d3 sprintf didn't use .data member of new arrays
Grumpy7
parents: 1211
diff changeset
1831 v43 = pTmpBuf2.data();*/
b237a61e61d3 sprintf didn't use .data member of new arrays
Grumpy7
parents: 1211
diff changeset
1832 sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1833 v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1834 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1835 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1836 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1837 LABEL_71:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1838 v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1839 color_default, pGlobalTXT_LocalizationStrings[561], 3);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1840 pAudioPlayer->StopChannels(-1, -1);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1841 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1842 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1843 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1844 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1845 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1846 if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1847 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1848 if ( pParty->uNumGold < s1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1849 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1850 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1851 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1852 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
778
Nomad
parents: 777 776
diff changeset
1853 return;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1854 }
778
Nomad
parents: 777 776
diff changeset
1855
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1856 Party::TakeGold(s1);
778
Nomad
parents: 777 776
diff changeset
1857
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1858 v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1859 if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1860 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1861 if ( _stricmp(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename) )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1862 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1863 SaveGame(1, 0);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
1864 strcpy(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1865
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1866 dword_6BE364_game_settings_1 |= 1u;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1867 _5B65B8_npcdata_hiword_house_or_other = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1868 dword_5B65BC = 0;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1869 _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1870 v11 = *((int *)v5 + 3);
978
9334a8c59c8d uGameState
Ritor1
parents: 956
diff changeset
1871 uGameState = GAME_STATE_2;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1872 _5B65A8_npcdata_uflags_or_other = v11;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1873 _5B65AC_npcdata_fame_or_other = v5->arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1874 _5B65B0_npcdata_rep_or_other = v5->arrival_z;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1875 dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1876 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1877 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1878 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1879 pIndoorCamera->sRotationY = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1880 pParty->uFlags |= 2u;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1881 pParty->vPosition.x = v5->arrival_x;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1882 pParty->vPosition.y = v5->arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1883 pParty->vPosition.z = v5->arrival_z;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1884 pParty->uFallStartY = pParty->vPosition.z;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1885 pParty->sRotationX = 0;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1886 pParty->sRotationY = v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1887 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1888 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1889 v12 = v5->uTravelTime;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1890 int _v47;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1891 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1892 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1893 v63 = SPEECH_SetSail;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1894 v13 = 2500;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1895 if ( CheckHiredNPCSpeciality(Sailor) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1896 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1897 if ( CheckHiredNPCSpeciality(Navigator) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1898 v12 -= 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1899 //_v47 = 45;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1900 if ( CheckHiredNPCSpeciality(Pirate) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1901 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1902 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1903 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1904 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1905 v63 = SPEECH_CarriageReady;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1906 v13 = 1500;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1907 //_v47 = 35;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1908 if ( CheckHiredNPCSpeciality(Horseman) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1909 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1910 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1911 if ( CheckHiredNPCSpeciality(Explorer) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1912 --v12;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1913 if ( v12 < 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1914 v12 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1915 RestAndHeal(1440 * v12);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1916 v1->PlaySound((PlayerSpeech)v63, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1917 v14 = GetTickCount();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1918 v15 = v14 + v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1919 if ( v15 < v14 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1920 v15 = v14;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1921 while ( GetTickCount() < v15 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1922 sqrt(3.1415926);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1923 while ( sub_4BD8B5() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1924 ;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1925 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
778
Nomad
parents: 777 776
diff changeset
1926 return;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1927 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1928 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1929 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1930 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1931 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1932 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1933 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1934 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1935 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1936
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1937
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1938
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1939
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1940
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1941
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1942 //----- (004B68EA) --------------------------------------------------------
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
1943 bool __fastcall IsTravelAvailable(int a1)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1944 {
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
1945 for (uint i = 0; i < 4; ++i)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1946 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1947 uint route = transport_routes[a1][i];
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1948 if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1949 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1950 if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
1951 return true;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1952 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1953 }
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
1954 return false;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1955 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1956
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1957
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1958
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1959 //----- (004B7911) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1960 void __cdecl TownHallDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1961 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1962 GUIWindow *v0; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1963 int v1; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1964 int v2; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1965 GUIFont *v3; // ST20_4@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1966 int v4; // eax@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1967 MonsterInfo *v5; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1968 unsigned int v6; // ST20_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1969 char *v7; // ST1C_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1970 unsigned int v8; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1971 int v9; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1972 char *v10; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1973 signed int v11; // ebx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1974 signed int i; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1975 int v13; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1976 GUIWindow *v14; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1977 __int64 v15; // qax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1978 signed int v16; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1979 int v17; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1980 unsigned __int8 v18; // sf@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1981 char **v19; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1982 GUIButton *v20; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1983 GUIButton *v21; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1984 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1985 unsigned int v23; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1986 unsigned __int16 v24; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1987 GUIWindow a1; // [sp+Ch] [bp-110h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1988 GUIWindow w; // [sp+60h] [bp-BCh]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1989 GUIWindow _this; // [sp+B4h] [bp-68h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1990 int v28; // [sp+108h] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1991 int v29; // [sp+10Ch] [bp-10h]@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1992 int v30; // [sp+110h] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1993 int v31; // [sp+114h] [bp-8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1994 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1995
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1996 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1997 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1998 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1999 _this.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
2000 v28 = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
2001 v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2002 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2003 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf.data(), 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2004 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2005 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2006 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2007 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2008 v11 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2009 pOutString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2010 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2011 if ( pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2012 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2013 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2014 v11 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2015 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2016 for ( i = 0; i < v11; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2017 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2018 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2019 pOutString = (GUIFont *)((char *)pOutString + v13);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2020 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2021 v29 = (100 - (signed int)pOutString) / v11;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2022 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2023 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2024 v16 = v15 - HIDWORD(v15);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2025 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2026 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2027 v17 = (v16 >> 1) - v29 / 2 + 158;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2028 v18 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2029 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2030 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2031 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2032 v31 = 2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2033 v19 = pShopOptions.data();
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2034 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2035 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2036 v20 = v14->GetControl((unsigned int)pOutString);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2037 v21 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2038 v20->uY = v29 + v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2039 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2040 v23 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2041 v21->uHeight = v22;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2042 v17 = v23 + v22 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2043 v21->uW = v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2044 v24 = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2045 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2046 v24 = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2047 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2048 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2049 ++v31;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2050 ++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2051 pOutString = (GUIFont *)((char *)pOutString + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2052 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2053 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2054 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2055 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2056 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2057
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2058 case HOUSE_DIALOGUE_TOWNHALL_99:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2059 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2060 v5 = &pMonsterStats->pInfos[word_F8B1A0];
949
Nomad
parents: 948
diff changeset
2061 v6 = TargetColor(0xFFu, 0xFFu, 0xFFu);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2062 v7 = v5->pName;
949
Nomad
parents: 948
diff changeset
2063 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2064 sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
1217
b237a61e61d3 sprintf didn't use .data member of new arrays
Grumpy7
parents: 1211
diff changeset
2065 sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * v5->uLevel);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2066 current_npc_text = pTmpBuf2.data();
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2067 memcpy(&a1, pDialogueWindow, sizeof(a1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2068 w.uFrameWidth = 458;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2069 w.uFrameZ = 457;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2070 pOutString = pFontArrus;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2071 v9 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &w, 13, 0) + 7;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2072 if ( 352 - v9 < 8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2073 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2074 pOutString = pFontCreate;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
2075 v9 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2076 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2077
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2078 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2079 pRenderer->_4A6A68(8u, 352 - v9, pTex, pTex->uTextureHeight - v9);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2080 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
2081 v10 = FitTextInAWindow(current_npc_text, pOutString, &w, 0xDu, 0);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2082 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2083 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2084 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2085 case HOUSE_DIALOGUE_TOWNHALL_100:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2086 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2087 v0 = window_SpeakInHouse;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2088 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2089 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2090 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay" "How Much?"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2091 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf.data(), 3u);
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1020
diff changeset
2092 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2093 v3 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2094 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2095 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2096 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2097 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2098 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2099 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2100 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2101 v2 = v1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2102 if ( v1 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2103 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2104 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2105 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2106 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2107 if ( v1 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2108 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2109 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2110 v2 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2111 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2112 if ( v2 > pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2113 v2 = pParty->uFine;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2114 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2115 pParty->uFine -= v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2116 if ( pParty->uFine < 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2117 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2118 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2119 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2120 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2121 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2122 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2123 {
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2124 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2125 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2126 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2127 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2128 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2129 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2130 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2131 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2132 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2133 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2134 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2135 }
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1020
diff changeset
2136
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1020
diff changeset
2137
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2138
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2139 //----- (004B7D7E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2140 void __cdecl BankDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2141 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2142 GUIWindow *v0; // eax@4
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2143 //int v1; // ecx@5
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2144 int v2; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2145 unsigned int v3; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2146 GUIFont *v4; // ST10_4@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2147 int v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2148 int v6; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2149 unsigned int v7; // esi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2150 unsigned __int16 v8; // ax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2151 unsigned __int16 v9; // ax@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2152 char *v10; // [sp-8h] [bp-70h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2153 char *v11; // [sp-4h] [bp-6Ch]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2154 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2155 __int16 v13[2]; // [sp+60h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2156 __int16 v14[2]; // [sp+64h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2157
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2158 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2159 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2160 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2161 _this.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
2162 *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
2163 *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2164 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2165 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf.data(), 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2166 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2167 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2168 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2169 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2170 v8 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2171 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2172 v8 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2173 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2174 v9 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2175 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2176 v9 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2177 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2178 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2179 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2180 case HOUSE_DIALOGUE_BANK_7:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2181 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2182 v0 = window_SpeakInHouse;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2183 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2184 {
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2185 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2186 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2187 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2188 v7 = v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2189 if ( !v6 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2190 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2191 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2192 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2193 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2194 if ( v6 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2195 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2196 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2197 v7 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2198 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2199 if ( v7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2200 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2201 Party::TakeGold(v7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2202 pParty->uNumGoldInBank += v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2203 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2204 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2205 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2206 v0 = window_SpeakInHouse;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2207 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2208 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2209 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2210 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2211 if (window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2212 return;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2213 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2214 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2215 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2216 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2217 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2218 v10 = pGlobalTXT_LocalizationStrings[60];
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2219 sprintf(pTmpBuf.data(), "%s\n%s", v10, v11);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2220 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2221 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2222 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2223 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2224 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2225 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2226 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2227
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2228 case HOUSE_DIALOGUE_BANK_8:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2229 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2230 v0 = window_SpeakInHouse;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2231 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2232 {
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2233 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2234 {
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2235 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2236 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2237 v3 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2238 if ( v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2239 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2240 if ( v2 > pParty->uNumGoldInBank )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2241 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2242 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2243 v3 = pParty->uNumGoldInBank;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2244 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2245 if ( v3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2246 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2247 Party::SetGold(pParty->uNumGold + v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2248 pParty->uNumGoldInBank -= v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2249 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2250 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2251 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2252 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2253 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2254 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2255 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2256 return;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
2257 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2258 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2259 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2260 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2261 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2262 v10 = pGlobalTXT_LocalizationStrings[244];
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2263 sprintfex(pTmpBuf.data(), "%s\n%s", v10, v11);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2264 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2265 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2266 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2267 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2268 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2269 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2270 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2271 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2272
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2273 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2274 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2275 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2276 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2277 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2278 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2279 // F8B19C: using guessed type int dword_F8B19C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2280
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2281 //----- (004B8285) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2282 void __cdecl TavernDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2283 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2284 int v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2285 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2286 double v2; // st7@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2287 signed int v3; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2288 int v4; // ecx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2289 int v5; // esi@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2290 signed int v6; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2291 int v7; // ecx@5
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2292 int pNumString; // edi@16
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2293 signed int v9; // esi@16
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2294 unsigned int pNumActiveItem; // esi@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2295 int v11; // eax@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2296 unsigned int v12; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2297 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2298 int v14; // ecx@26
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2299 //GUIButton *v15; // eax@28
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2300 //GUIButton *v16; // esi@28
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2301 int v17; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2302 char *v18; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2303 int v19; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2304 unsigned int v20; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2305 int v21; // edx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2306 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2307 unsigned __int16 v23; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2308 int v24; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2309 int v25; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2310 char *v26; // esi@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2311 int v27; // edi@46
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2312 unsigned int pColorText; // eax@57
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2313 signed int v31; // eax@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2314 //GUIWindow *v33; // edi@64
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2315 int v34; // eax@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2316 int v35; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2317 int v36; // esi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2318 char v37; // sf@64
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2319 GUIButton *pButton; // eax@65
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2320 int v39; // edx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2321 int v40; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2322 int v41; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2323 int v42; // ecx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2324 unsigned int v43; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2325 int v44; // edx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2326 int v45; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2327 int v46; // ecx@72
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2328 int v47; // eax@74
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2329 signed int v48; // edi@77
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2330 signed int i; // esi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2331 int v50; // eax@80
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2332 //GUIWindow *v51; // ecx@81
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2333 _QWORD v52; // qax@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2334 signed int v53; // edi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2335 int v54; // edi@81
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2336 //GUIButton *v55; // esi@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2337 const char **v56; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2338 int v57; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2339 unsigned int v58; // ecx@83
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2340 //Player *v59; // edx@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2341 unsigned __int16 v60; // ax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2342 int v61; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2343 char *v63; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2344 GUIFont *v64; // edx@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2345 GUIFont *v65; // edi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2346 unsigned int v66; // [sp-10h] [bp-284h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2347 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2348 int v68; // [sp-Ch] [bp-280h]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2349 char *v69; // [sp-8h] [bp-27Ch]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2350 int v70; // [sp-8h] [bp-27Ch]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2351 unsigned int v71; // [sp-4h] [bp-278h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2352 const char *v72; // [sp-4h] [bp-278h]@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2353 unsigned int v73; // [sp-4h] [bp-278h]@99
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2354 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2355 char pTopic4[100]; // [sp+70h] [bp-204h]@59
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2356 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2357 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2358 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2359 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2360 char *Str[2]; // [sp+244h] [bp-30h]@30
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2361 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2362 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2363 int v83; // [sp+254h] [bp-20h]@1
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2364 int pColorYellow; // [sp+258h] [bp-1Ch]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2365 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2366 int all_text_height; // [sp+260h] [bp-14h]@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2367 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2368 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2369 int v89; // [sp+268h] [bp-Ch]@1
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2370 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2371 int v91; // [sp+270h] [bp-4h]@3
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2372 GUIFont *pOutString;
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2373 unsigned __int8 pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2374 int pTextHeight;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2375
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2376 pPlayer = pPlayers[uActiveCharacter];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2377 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2378 dialog_window.uFrameX = 483;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2379 dialog_window.uFrameWidth = 148;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2380 dialog_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
2381 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
2382 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2383 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2384 *(float *)&v83 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2385 *(float *)&v89 = v2 * v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2386 v3 = (signed __int64)(*(float *)&v89 * 0.1);
662
Ritor1
parents: 661
diff changeset
2387 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
Ritor1
parents: 661
diff changeset
2388 if ( pItemNum < v3 / 3 )
Ritor1
parents: 661
diff changeset
2389 pItemNum = v3 / 3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2390 v5 = 1;
662
Ritor1
parents: 661
diff changeset
2391 pOutString = (GUIFont *)pItemNum;
Ritor1
parents: 661
diff changeset
2392 if ( pItemNum <= 0 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2393 pOutString = (GUIFont *)1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2394 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2395 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2396 if ( v7 < v6 / 3 )
662
Ritor1
parents: 661
diff changeset
2397 v7 = v6 / 3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2398 v83 = v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2399 if ( v7 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2400 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2401 v7 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2402 v83 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2403 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2404
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2405 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2406 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2407 case HOUSE_DIALOGUE_MAIN:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2408 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2409 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2410 return;
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2411
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2412 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2413 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2414 strcat(pTopic1, pTmpBuf2.data());
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2415 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2416 strcat(pTopic1, "\n \n");
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2417
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2418 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2419 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2420 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2421 strcat(pTopic2, pTmpBuf2.data());
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2422 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2423 strcat(pTopic2, "\n \n");
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2424
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2425 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2426 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2427 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2428 strcat(pTopic3, "\n \n");
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2429 pTopic4[0] = 0;
690
26dfde53decd ui fixing
Gloval
parents: 684
diff changeset
2430 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2431 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2432 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2433 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2434 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2435 }
662
Ritor1
parents: 661
diff changeset
2436 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2437 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2438 v37 = -pDialogueWindow->pNumPresenceButton < 0;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
2439 if ( !(v37 ^ (pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton)) )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2440 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2441 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2442 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2443 pButton = pDialogueWindow->GetControl(pNumActiveItem);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2444 if ( pButton->msg_param == 15 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2445 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2446 v46 = pTopic1Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2447 pButton->uHeight = pTopic1Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2448 pButton->uY = 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2449 v41 = v46 + 145;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2450 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2451 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2452 else if ( pButton->msg_param == 16 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2453 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2454 v44 = pTopic2Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2455 v45 = pTopic1Height + v36 + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2456 pButton->uHeight = pTopic2Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2457 pButton->uY = v45;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2458 v41 = v45 + v44 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2459 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2460 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2461 else if ( pButton->msg_param == 96 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2462 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2463 v42 = pTopic1Height + pTopic2Height + 2 * v36 + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2464 v43 = pTopic3Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2465 pButton->uY = v42;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2466 pButton->uHeight = v43;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2467 v41 = v43 + v42 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2468 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2469 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2470 else if ( pButton->msg_param == 101 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2471 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2472 v39 = pTopic1Height + 3 * v36 + pTopic4Height + pTopic2Height + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2473 v40 = pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2474 pButton->uHeight = pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2475 pButton->uY = v39;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2476 v41 = v39 + v40 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2477 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2478 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2479 pNumActiveItem++;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2480 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2481 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2482 sprintfex(pTmpBuf.data(), "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2483 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2484 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2485 }
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2486 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2487 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2488 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2489 }
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2490 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2491 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2492 pOutString = pFontArrus;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2493 strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
819
9359c114f98c More on screenshot
Nomad
parents: 791
diff changeset
2494 dialog_window.uFrameWidth = game_viewport_width;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2495 dialog_window.uFrameZ = 452;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2496 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2497 if ( 352 - pTextHeight < 8 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2498 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2499 pOutString = pFontCreate;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2500 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2501 }
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2502 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2503 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, pTex->uTextureHeight - pTextHeight);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2504 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2505 v63 = FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2506 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2507 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2508 }
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2509 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2510 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2511 strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
819
9359c114f98c More on screenshot
Nomad
parents: 791
diff changeset
2512 dialog_window.uFrameWidth = game_viewport_width;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2513 dialog_window.uFrameZ = 452;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2514 v61 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2515 pTextHeight = v61 + 7;
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2516 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
5a2dbb00c399 Code cleaning.
Nomad
parents: 920
diff changeset
2517 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, pTex->uTextureHeight - (v61 + 7));
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2518 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2519 v63 = FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2520 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2521 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2522 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2523 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2524 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2525 if ( pArcomageGame->bGameInProgress == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2526 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2527 if ( pArcomageGame->uGameResult )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2528 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2529 if ( pArcomageGame->uGameResult == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2530 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2531 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2532 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2533 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2534 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2535 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2536 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2537 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2538 strcpy(pTmpBuf.data(), v72);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2539 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2540 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2541 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2542 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2543 case HOUSE_DIALOGUE_TAVERN_REST:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2544 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2545 if ( pParty->uNumGold >= (unsigned int)pOutString )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2546 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2547 Party::TakeGold((unsigned int)pOutString);
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
2548 v27 = (int)window_SpeakInHouse->ptr_1C;//107
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2549 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2550 dialog_menu_id = HOUSE_DIALOGUE_NULL;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2551 sub_4BD8B5();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2552 sub_4B1D27();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2553 pVideoPlayer->Unload();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2554 window_SpeakInHouse->Release();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2555 window_SpeakInHouse = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2556 if ( pMessageQueue_50CBD0->uNumMessages )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2557 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
2558 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_RentRoom;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2559 pMessageQueue_50CBD0->pMessages[0].param = v27;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2560 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2561 ++pMessageQueue_50CBD0->uNumMessages;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2562 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2563 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2564 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
736
Nomad
parents: 735
diff changeset
2565 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2566 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2567 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2568 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2569
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2570 case HOUSE_DIALOGUE_LEARN_SKILLS:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2571 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2572 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2573 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2574 v0 = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2575 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2576 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2577 if ( pItemNum < v9 / 3 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2578 pItemNum = v9 / 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2579 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2580 all_text_height = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2581 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2582 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2583 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2584 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
2585 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2586 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2587 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2588 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2589 v0++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2590 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2591 ++pNumActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2592 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2593 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2594 if ( v0 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2595 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2596 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2597 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2598 v91 = (149 - all_text_height) / v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2599 if ( (149 - all_text_height) / v0 > 32 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2600 v91 = 32;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2601 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2602 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2603 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2604 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2605 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2606 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2607 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2608 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
2609 v17 = pButton->msg_param - 36;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2610 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2611 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2612 pButton->uW = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2613 pButton->uHeight = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2614 pButton->uY = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2615 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2616 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2617 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2618 pButton->uY = v91 + v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2619 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2620 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2621 v14 = pTextHeight + pButton->uY - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2622 pButton->uW = v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2623 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2624 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2625 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2626 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2627 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2628 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2629 pItemNum++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2630 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2631 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2632 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2633 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2634 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2635 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2636 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2637 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2638 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2639 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
2640 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2641 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2642 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2643
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2644 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2645 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2646 *(_QWORD *)Str = pParty->uNumFoodRations;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2647 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2648 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2649 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2650 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2651 if ( uActiveCharacter )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2652 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2653 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2654 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2655 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2656 if ( pParty->uNumGold >= v7 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2657 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2658 Party::TakeGold(v7);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2659 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2660 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
2661 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2662 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2663 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2664 }
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
2665 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
736
Nomad
parents: 735
diff changeset
2666 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2667 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2668 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2669 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2670
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2671 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2672 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2673 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2674 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2675 v48 = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2676 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2677 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2678 pOutString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2679 if ( pParty->HasItem(0x28Bu) )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2680 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2681 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2682 v48 = 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2683 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2684 for ( i = 0; i < v48; ++i )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2685 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2686 all_text_height = (174 - all_text_height) / v48;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2687 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2688 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2689 v37 = -pDialogueWindow->pNumPresenceButton < 0;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2690 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2691 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2692 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2693 pNumString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2694 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2695 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2696 pButton = pDialogueWindow->GetControl(pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2697 pButton->uY = all_text_height + v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2698 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2699 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2700 v54 = pButton->uY + pTextHeight - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2701 pButton->uW = v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2702 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2703 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2704 pColorText = pColorWhite;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2705 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2706 pItemNum++;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2707 ++pNumString;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2708 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2709 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2710 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2711 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2712 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2713 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2714 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2715 default:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2716 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2717 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2718 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2719 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2720 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2721
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2722
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2723 //----- (004B910F) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2724 void __cdecl WeaponShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2725 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2726 int v0; // ebx@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2727 int pNumActiveItem; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2728 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2729 ItemGen *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2730 char *v5; // ecx@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2731 unsigned __int8 v6; // dl@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2732 char *v7; // edx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2733 int v9; // ST08_4@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2734 int v10; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2735 signed int v11; // esi@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2736 int v12; // ST08_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2737 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2738 int v14; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2739 char **v15; // esi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2740 int v16; // eax@24
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2741 //int v18; // edx@25
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2742 int v19; // edi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2743 unsigned __int8 v20; // sf@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2744 GUIButton *pButton; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2745 int pNewItem; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2746 unsigned int v24; // ecx@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2747 int v25; // edx@27
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2748 unsigned int pColorText; // ax@27
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2749 signed int v27; // esi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2750 int v28; // ST08_4@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2751 int v29; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2752 signed int v32; // esi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2753 unsigned int v33; // esi@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2754 int v34; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2755 unsigned int v35; // eax@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2756 int v36; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2757 __int32 v37; // ecx@51
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2758 int v40; // eax@53
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2759 char *v41; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2760 unsigned int v43; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2761 const char **v44; // edx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2762 int v45; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2763 int v47; // eax@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2764 const char **v48; // eax@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2765 unsigned int v49; // esi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2766 Texture *v50; // eax@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2767 int v51; // edi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2768 int v52; // esi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2769 Texture *v53; // ST1C_4@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2770 int v54; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2771 signed int v55; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2772 SHORT v56; // di@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2773 bool v57; // eax@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2774 const char *v58; // ecx@84
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2775 POINT *v59; // esi@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2776 LONG v60; // ecx@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2777 int v61; // eax@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2778 int v62; // ecx@90
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2779 ItemGen *pItemInShop; // esi@90
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2780 int v64; // eax@95
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2781 int all_text_height; // esi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2782 char **v66; // edi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2783 int v67; // eax@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2784 int v69; // edx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2785 int v70; // edi@98
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2786 int v71;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2787 const char **v72; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2788 int pTextHeight; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2789 unsigned int v74; // ecx@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2790 int v78; // [sp-14h] [bp-10Ch]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2791 ItemGen *v79; // [sp-10h] [bp-108h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2792 int v80; // [sp-10h] [bp-108h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2793 void *v81; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2794 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2795 int v83; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2796 char *v84; // [sp-8h] [bp-100h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2797 __int64 *v85; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2798 unsigned int v86; // [sp-4h] [bp-FCh]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2799 POINT v87; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2800 POINT v88; // [sp+14h] [bp-E4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2801 POINT v89; // [sp+1Ch] [bp-DCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2802 POINT v90; // [sp+24h] [bp-D4h]@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2803 POINT v91; // [sp+2Ch] [bp-CCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2804 POINT v92; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2805 POINT v93; // [sp+3Ch] [bp-BCh]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2806 POINT v94; // [sp+44h] [bp-B4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2807 POINT v95; // [sp+4Ch] [bp-ACh]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2808 POINT v96; // [sp+54h] [bp-A4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2809 POINT v97; // [sp+5Ch] [bp-9Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2810 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2811 POINT v99; // [sp+6Ch] [bp-8Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2812 POINT v100; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2813 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2814 char *Str; // [sp+D0h] [bp-28h]@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2815 __int32 v103; // [sp+D4h] [bp-24h]@25
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2816 int pColorYellow; // [sp+D8h] [bp-20h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2817 int pColorWhite; // [sp+DCh] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2818 POINT v106; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2819 Player *pPlayer; // [sp+E8h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2820 int pItemNum; // [sp+ECh] [bp-Ch]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2821 const char **v109; // [sp+F0h] [bp-8h]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2822 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2823 int pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2824
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2825 pPlayer = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2826 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2827 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2828 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2829 dialog_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
2830 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
2831 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2832
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2833 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2834 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2835 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2836 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2837 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2838 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2839 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2840 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2841 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2842 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2843 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2844 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2845 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2846 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2847 v103 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2848 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2849 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2850 v20 = -pDialogueWindow->pNumPresenceButton < 0;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
2851 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2852 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2853 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2854 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2855 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2856 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2857 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2858 pButton->uY = v103 + v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2859 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2860 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2861 v19 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2862 pButton->uW = v19;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2863 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2864 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2865 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2866 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2867 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2868 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2869 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2870 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2871 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2872 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2873 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2874 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2875 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2876
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2877 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2878 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2879 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2880 v48 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2881 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2882 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2883 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2884 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2885 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
668
28109e4eee44 standard weapon shop fix
zipi
parents: 662
diff changeset
2886 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2887 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2888 v49 = word_F8B158[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2889 v50 = ItemsInShopTexture[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2890 v49 += 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2891 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2892 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2893 sub_40F92A(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2894 v48 = v109;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2895 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2896 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2897 v48 = (const char **)((char *)v48 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2898 v109 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2899 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2900 while ( (signed int)v48 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2901 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2902 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2903 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2904 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2905 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2906 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2907 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2908 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
2909 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2910 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2911 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2912 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2913 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2914 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2915 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2916 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2917 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2918 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2919 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2920 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2921 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2922 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2923 v58 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2924 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2925 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2926 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2927 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2928 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2929 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2930 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2931 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2932 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2933 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2934 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2935 v106.x = v60;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2936 v61 = (int)window_SpeakInHouse->ptr_1C;//maybe ptr_1C - BuildID_2Events
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2937 // v62 = 9 * (v60 + 12 * v61);
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2938 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2939 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2940 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2941 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2942 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2943 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2944 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2945 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2946 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2947 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2948 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2949 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2950 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2951 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2952 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2953 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2954 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2955 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2956 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2957 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2958 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2959 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2960 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2961 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2962 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2963 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2964
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2965 case HOUSE_DIALOGUE_SHOP_SELL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2966 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2967 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
2968 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2969 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2970 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2971 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2972 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2973 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2974 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2975 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2976 v79 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2977 v13 = pPlayer->SelectPhrasesTransaction(v79, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2978 v7 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2979 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2980 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2981 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2982 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2983
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2984 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2985 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2986 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
2987 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2988 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2989 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2990 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2991 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2992 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2993 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2994 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2995 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2996 if (!v4->Identified())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2997 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
2998 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2999 v7 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3000 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3001 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3002 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3003 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3004 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3005 v7 = BuilDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3006 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3007 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3008 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3009 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3010 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3011
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3012 case HOUSE_DIALOGUE_SHOP_REPAIR:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3013 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3014 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
3015 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3016 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3017 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3018 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3019 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3020 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3021 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
3022 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3023 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3024 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3025 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3026 v7 = BuilDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3027 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3028 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3029 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3030 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3031 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3032
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3033 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3034 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3035 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
3036 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3037 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3038 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3039 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3040 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3041 for ( int i = 0; i < 3; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3042 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3043 v103 = (174 - all_text_height) / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3044 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3045 v70 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3046 v20 = -pDialogueWindow->pNumPresenceButton < 0;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
3047 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3048 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3049 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3050 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3051 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3052 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3053 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3054 pButton->uY = v103 + v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3055 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3056 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3057 v70 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3058 pButton->uW = v70;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3059 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3060 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3061 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3062 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3063 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3064 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3065 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3066 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3067 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3068 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3069 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3070 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3071
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3072 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3073 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3074 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3075 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3076 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3077 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3078 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3079 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3080 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3081 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3082 v52 = word_F8B158[(signed int)v109] + 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3083 v53 = ItemsInShopTexture[(signed int)v109];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3084 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3085 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3086 sub_40F92A(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3087 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3088 v109 = (const char **)((char *)v109 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3089 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3090 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3091 while ( (signed int)v109 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3092 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3093 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3094 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3095 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3096 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3097 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3098 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3099 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3100 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3101 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3102 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3103 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3104 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3105 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3106 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3107 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3108 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3109 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3110 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3111 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3112 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3113 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3114 v58 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3115 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3116 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3117 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3118 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3119 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3120 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3121 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3122 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3123 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3124 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3125 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3126 v106.x = v60;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3127 v61 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3128 // v62 = 9 * (v60 + 12 * v61);
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3129 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3130 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3131 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3132 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3133 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3134 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3135 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3136 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3137 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3138 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3139 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3140 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3141 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3142 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3143 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3144 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3145 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3146 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3147 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3148 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3149 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3150 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3151 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3152 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3153 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3154 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3155
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3156 case HOUSE_DIALOGUE_LEARN_SKILLS:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3157 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3158 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3159 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3160 v0 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3161 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3162 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3163 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3164 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3165 if ( pItemNum < v32 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3166 pItemNum = v32 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3167 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3168 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3169 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3170 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3171 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3172 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3173 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3174 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3175 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3176 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3177 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3178 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3179 v35 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3180 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3181 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3182 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3183 v0++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3184 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3185 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3186 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3187 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3188 if ( !v0 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3189 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3190 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3191 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3192 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3193 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3194 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3195 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3196 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3197 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3198 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3199 v103 = (149 - all_text_height) / v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3200 if ( (149 - all_text_height) / v0 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3201 v103 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3202 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3203 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3204 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3205 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3206 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3207 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3208 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3209 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3210 v40 = pButton->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3211 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3212 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3213 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3214 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3215 pButton->uY = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3216 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3217 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3218 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3219 pButton->uY = v103 + v37;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3220 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3221 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3222 v37 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3223 pButton->uW = v37;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3224 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3225 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3226 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3227 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3228 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3229 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3230 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3231 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3232 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3233 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3234 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3235 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3236 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3237 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3238 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3239 pNumActiveItem = dialog_menu_id - 96;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3240 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3241 pNumActiveItem = dialog_menu_id - 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3242 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3243 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3244 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3245 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3246
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3247
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3248
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3249 //----- (004B9CC6) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3250 void __cdecl AlchemistDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3251 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3252 int v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3253 int pNumActiveItem; // eax@7
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3254 signed int v5; // esi@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3255 unsigned int v6; // esi@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3256 int v7; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3257 unsigned int v8; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3258 int v9; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3259 int v10; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3260 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3261 char *v14; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3262 int v15; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3263 unsigned int v16; // ecx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3264 int v17; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3265 int v18; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3266 int v20; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3267 char *v21; // edx@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3268 int v22; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3269 char **v23; // edi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3270 int v24; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3271 int v26; // edx@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3272 int v27; // edi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3273 unsigned __int8 v28; // sf@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3274 const char **v30; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3275 int v31; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3276 unsigned int v32; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3277 int v34; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3278 signed int v36; // esi@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3279 ItemGen *v37; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3280 char *v38; // ecx@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3281 unsigned __int8 v39; // dl@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3282 int v40; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3283 int v41; // ST08_4@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3284 int v42; // eax@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3285 signed int v43; // esi@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3286 int v44; // ST08_4@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3287 int v45; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3288 Texture *v46; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3289 unsigned int v47; // edi@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3290 unsigned int v48; // esi@57
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3291 int v49; // edx@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3292 Texture *v50; // ecx@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3293 unsigned int v51; // edi@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3294 unsigned int v52; // esi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3295 int v53; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3296 Texture *v54; // ecx@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3297 unsigned int v55; // edi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3298 unsigned int v56; // esi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3299 int v57; // edx@85
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3300 Texture *v58; // ecx@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3301 unsigned int v59; // edi@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3302 unsigned int v60; // esi@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3303 int v61; // edx@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3304 signed int v62; // ecx@102
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3305 SHORT v63; // di@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3306 bool v64; // eax@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3307 const char *v65; // ecx@112
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3308 POINT *v66; // esi@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3309 int v67; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3310 int v68; // eax@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3311 int v69; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3312 ItemGen *v70; // esi@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3313 int v71; // eax@123
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3314 int all_text_height; // edi@125
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3315 char **v73; // esi@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3316 int v74; // eax@126
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3317 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3318 int v76; // edx@127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3319 int v77; // edi@127
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3320 GUIButton *pButton; // esi@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3321 const char **v79; // eax@129
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3322 int pTextHeight; // eax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3323 unsigned int v81; // ecx@129
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3324 unsigned int pColorText; // ax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3325 int v85; // [sp-14h] [bp-ECh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3326 int v86; // [sp-10h] [bp-E8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3327 ItemGen *v87; // [sp-10h] [bp-E8h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3328 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3329 void *v89; // [sp-Ch] [bp-E4h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3330 char *v90; // [sp-8h] [bp-E0h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3331 int v91; // [sp-8h] [bp-E0h]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3332 unsigned int v92; // [sp-4h] [bp-DCh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3333 __int64 *v93; // [sp-4h] [bp-DCh]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3334 POINT v94; // [sp+Ch] [bp-CCh]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3335 POINT v95; // [sp+14h] [bp-C4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3336 POINT v96; // [sp+1Ch] [bp-BCh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3337 POINT v97; // [sp+24h] [bp-B4h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3338 POINT v98; // [sp+2Ch] [bp-ACh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3339 POINT v99; // [sp+34h] [bp-A4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3340 POINT v100; // [sp+3Ch] [bp-9Ch]@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3341 POINT v101; // [sp+44h] [bp-94h]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3342 POINT v102; // [sp+4Ch] [bp-8Ch]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3343 POINT a2; // [sp+54h] [bp-84h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3344 GUIWindow dialog_window; // [sp+5Ch] [bp-7Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3345 int v105; // [sp+B0h] [bp-28h]@19
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3346 int pColorYellow; // [sp+B4h] [bp-24h]@1
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3347 int Str; // [sp+B8h] [bp-20h]@23
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3348 int pColorWhite; // [sp+BCh] [bp-1Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3349 __int32 v109; // [sp+C0h] [bp-18h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3350 Player *pPlayer; // [sp+C4h] [bp-14h]@1
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3351 int pNumString; // [sp+C8h] [bp-10h]@9
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3352 unsigned int v112; // [sp+CCh] [bp-Ch]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3353 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3354 int v114; // [sp+D4h] [bp-4h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3355
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3356 pPlayer = pPlayers[uActiveCharacter];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3357 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3358 dialog_window.uFrameX = 483;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3359 dialog_window.uFrameWidth = 148;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3360 dialog_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
3361 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
3362 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3363 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3364 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3365 case HOUSE_DIALOGUE_MAIN:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3366 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3367 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3368 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3369 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3370 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3371 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3372 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3373 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3374 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3375 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3376 Str = (174 - all_text_height) / 4;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3377 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3378 v76 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3379 v77 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3380 v28 = -pDialogueWindow->pNumPresenceButton < 0;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
3381 if ( v28 ^ (pNumActiveItem > v76) )
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3382 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3383 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3384 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3385 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3386 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3387 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3388 pButton->uY = Str + v77;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3389 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3390 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3391 v77 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3392 pButton->uW = v77;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3393 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3394 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3395 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3396 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3397 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3398 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3399 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3400 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3401 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3402 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3403 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3404 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3405 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3406 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3407 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3408 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3409 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3410 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3411 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3412 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3413 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3414 v46 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3415 v47 = 152 - v46->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3416 if ( (signed int)v47 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3417 v47 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3418 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3419 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3420 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3421 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3422 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3423 v49 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3424 if ( (signed int)v48 > 457 - v49 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3425 v48 = 457 - v49;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3426 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3427 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3428 else if ( (signed int)v48 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3429 v48 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3430 pRenderer->DrawTextureTransparent(v48, v47, v46);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3431 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3432 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3433 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3434 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3435 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3436 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3437 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3438 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3439 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114 + 6].uItemID)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3440 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3441 v50 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3442 v51 = 308 - v50->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3443 if ( (signed int)v51 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3444 v51 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3445 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3446 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3447 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3448 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3449 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3450 v53 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3451 if ( (signed int)v52 > 457 - v53 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3452 v52 = 457 - v53;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3453 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3454 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3455 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3456 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3457 if ( (signed int)v52 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3458 v52 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3459 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3460 pRenderer->DrawTextureTransparent(v52, v51, v50);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3461 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3462 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3463 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3464 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3465 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3466 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3467 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3468 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3469 v109 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3470 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3471 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3472 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3473 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3474 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3475 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3476 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3477 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3478 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3479 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3480 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3481 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3482 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3483 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3484 else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3485 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3486 v65 = pGlobalTXT_LocalizationStrings[195];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3487 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3488 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3489 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3490 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3491 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3492 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3493 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3494 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3495 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3496 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3497 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3498 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3499 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3500 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3501 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3502 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3503 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3504 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3505 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3506 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3507 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3508 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3509 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3510 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3511 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3512 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3513 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3514 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3515 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3516 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3517 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3518 return ;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3519 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3520 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3521 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3522 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3523 case HOUSE_DIALOGUE_SHOP_SELL:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3524 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3525 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
3526 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3527 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3528 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3529 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3530 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3531 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3532 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3533 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3534 v87 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3535 v45 = pPlayer->SelectPhrasesTransaction(v87, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3536 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3537 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3538 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3539 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3540 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3541 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3542 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3543 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
3544 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3545 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3546 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3547 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3548 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3549 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3550 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3551 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3552 v37 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3553 if (!v37->Identified())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3554 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3555 v42 = pPlayer->SelectPhrasesTransaction(v37, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3556 v38 = (char *)pMerchantsIdentifyPhrases[v42];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3557 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3558 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3559 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3560 v38 = "%24";
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3561 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3562 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v37, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3563 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3564 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3565 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3566 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3567 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3568 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3569 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
3570 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3571 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3572 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3573 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3574 for ( int i = 0; i < 2; ++i )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3575 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3576 Str = (174 - all_text_height) / 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3577 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3578 v26 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3579 v27 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3580 v28 = -pDialogueWindow->pNumPresenceButton < 0;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
3581 if ( v28 ^ (pNumActiveItem > v26) )
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3582 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3583 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3584 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3585 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3586 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3587 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3588 pButton->uY = Str + v27;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3589 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3590 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3591 v27 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3592 pButton->uW = v27;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3593 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3594 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3595 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3596 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3597 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3598 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3599 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3600 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3601 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3602 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3603 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3604 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3605 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3606 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3607 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3608 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3609 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3610 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3611 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3612 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3613 v54 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3614 v55 = 152 - v54->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3615 if ( (signed int)v55 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3616 v55 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3617 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3618 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3619 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3620 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3621 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3622 v57 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3623 if ( (signed int)v56 > 457 - v57 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3624 v56 = 457 - v57;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3625 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3626 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3627 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3628 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3629 if ( (signed int)v56 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3630 v56 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3631 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3632 pRenderer->DrawTextureTransparent(v56, v55, v54);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3633 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3634 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3635 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3636 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3637 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3638 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3639 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3640 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3641 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114 + 6].uItemID) //not itemid
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3642 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3643 v58 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3644 v59 = 308 - v58->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3645 if ( (signed int)v59 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3646 v59 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3647 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3648 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3649 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3650 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3651 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3652 v61 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3653 if ( (signed int)v60 > 457 - v61 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3654 v60 = 457 - v61;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3655 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3656 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3657 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3658 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3659 if ( (signed int)v60 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3660 v60 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3661 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3662 pRenderer->DrawTextureTransparent(v60, v59, v58);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3663 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3664 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3665 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3666 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3667 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3668 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3669 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3670 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3671 v109 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3672 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3673 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3674 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3675 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3676 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3677 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3678 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3679 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3680 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3681 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3682 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3683 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3684 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3685 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3686 else
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3687 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3688 v65 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3689 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3690 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3691 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3692 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3693 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3694 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3695 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3696 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3697 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3698 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3699 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3700 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3701 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3702 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3703 v109 = v67;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3704 v68 = (int)window_SpeakInHouse->ptr_1C;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3705 // v69 = 9 * (v67 + 12 * v68);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3706 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3707 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3708 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3709 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3710 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
3711 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, v68, 2);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3712 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3713 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3714 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3715 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3716 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3717 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3718 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3719 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3720 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3721 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3722 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3723 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3724 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3725 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3726 case HOUSE_DIALOGUE_LEARN_SKILLS:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3727 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3728 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3729 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3730 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3731 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3732 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3733 if ( pItemNum < v5 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3734 pItemNum = v5 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3735 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3736 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3737 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3738 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3739 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3740 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3741 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3742 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3743 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3744 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3745 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3746 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3747 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3748 v8 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3749 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v8] && !pPlayer->pActiveSkills[v8] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3750 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3751 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v8], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3752 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3753 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3754 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3755 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3756 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3757 if ( !v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3758 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3759 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3760 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3761 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3762 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3763 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3764 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3765 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3766 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3767 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3768 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
3769 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3770 v18 = (149 - all_text_height) / v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3771 if ( (149 - all_text_height) / v114 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3772 v18 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3773 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3774 v105 = (149 - v114 * v18 - all_text_height) / 2 - v18 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3775 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3776 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3777 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3778 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3779 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3780 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3781 v13 = pButton->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3782 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v13] || pPlayer->pActiveSkills[v13] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3783 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3784 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3785 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3786 pButton->uY = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3787 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3788 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3789 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3790 pButton->uY = v18 + v105;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3791 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v13], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3792 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3793 v105 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3794 pButton->uW = v105;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3795 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3796 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3797 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3798 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v13], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3799 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3800 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3801 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3802 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3803 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3804 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3805 return;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3806 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3807 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3808 default:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3809 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3810 return;// (POINT *)dialog_menu_id - 96;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3811 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3812 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3813 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3814
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3815 //----- (004BA928) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3816 void __cdecl ArmorShopDialog()
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3817 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3818 signed int v1; // esi@8
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3819 unsigned int v2; // eax@10
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3820 ItemGen *v3; // eax@11
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3821 char *v5; // ecx@12
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3822 char *v6; // eax@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3823 int v8; // eax@15
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3824 signed int v9; // esi@17
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3825 unsigned int v10; // eax@19
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3826 char *v11; // edi@19
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3827 int v12; // ST08_4@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3828 int v13; // eax@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3829 char *v15; // ecx@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3830 char **v16; // edi@22
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3831 int all_text_height; // ebx@22
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3832 char **v18; // esi@22
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3833 int v19; // eax@23
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3834 GUIWindow *v20; // ecx@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3835 int v21; // eax@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3836 int v22; // edx@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3837 int v23; // ebx@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3838 unsigned __int8 v24; // sf@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3839 GUIButton *pButton; // eax@26
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3840 unsigned int v28; // ecx@26
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3841 int v29; // edx@26
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3842 signed int v31; // esi@31
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3843 unsigned int v32; // eax@33
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3844 int v33; // eax@34
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3845 int v35; // eax@35
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3846 char *v36; // edx@36
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3847 signed int v38; // esi@42
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3848 unsigned int v39; // esi@44
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3849 int v40; // eax@44
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3850 unsigned int v41; // eax@45
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3851 int v42; // eax@47
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3852 int v43; // ecx@52
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3853 int v46; // eax@54
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3854 unsigned int v49; // ecx@56
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3855 int v51; // eax@56
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3856 int v53; // eax@60
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3857 int textureH; // eax@60
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3858 signed int textureW; // ebx@65
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3859 Texture *v56; // eax@67
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3860 unsigned int pY_item; // edi@68
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3861 Texture *v58; // ST1C_4@68
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3862 int v59; // eax@68
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3863 int v60; // edi@69
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3864 signed int v61; // ebx@73
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3865 Texture *v62; // eax@75
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3866 int v63; // edi@76
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3867 Texture *v64; // ST1C_4@76
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3868 unsigned int v65; // ST18_4@76
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3869 int v66; // eax@76
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3870 int v67; // edi@77
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3871 signed int v68; // ecx@81
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3872 const char *pStatusText; // ecx@91
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3873 void *v72; // eax@95
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3874 POINT *v73; // esi@97
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3875 int v74; // ecx@97
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3876 int v75; // eax@98
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3877 int v76; // ecx@98
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3878 ItemGen *selected_item; // ecx@99
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3879 unsigned __int8 v78; // bl@104
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3880 int v80; // ebx@105
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3881 char **v81; // esi@105
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3882 int v82; // eax@106
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3883 int v86; // ebx@107
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3884 int pTextHeight; // eax@109
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3885 unsigned int v90; // ecx@109
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3886 int pNumString; // edx@109
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3887 unsigned __int16 pTextColor; // ax@109
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3888 signed int v93; // edx@114
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3889 POINT *v94; // edi@120
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3890 __int32 v95; // ecx@120
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3891 void *v96; // ST14_4@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3892 unsigned __int8 v97; // bl@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3893 ItemGen *v98; // ST10_4@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3894 int v99; // eax@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3895 char *v100; // eax@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3896 const char *v101; // ST18_4@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3897 unsigned __int16 v102; // ST14_2@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3898 int v103; // eax@122
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3899 signed int v104; // edi@123
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3900 Texture *v105; // eax@125
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3901 int v106; // ebx@126
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3902 unsigned int v108; // ST18_4@126
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3903 int v109; // eax@126
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3904 int v110; // ebx@127
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3905 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3906 unsigned int v112; // [sp-14h] [bp-118h]@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3907 int v113; // [sp-14h] [bp-118h]@36
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3908 unsigned int v115; // [sp-10h] [bp-114h]@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3909 ItemGen *v116; // [sp-10h] [bp-114h]@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3910 int v117; // [sp-10h] [bp-114h]@36
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3911 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3912 char *v121; // [sp-8h] [bp-10Ch]@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3913 int v122; // [sp-8h] [bp-10Ch]@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3914 unsigned int v123; // [sp-4h] [bp-108h]@13
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3915 __int64 *v124; // [sp-4h] [bp-108h]@20
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3916 int v125; // [sp-4h] [bp-108h]@68
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3917 int v126; // [sp-4h] [bp-108h]@76
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3918 int v127; // [sp-4h] [bp-108h]@126
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3919 POINT v128; // [sp+Ch] [bp-F8h]@8
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3920 POINT v129; // [sp+14h] [bp-F0h]@18
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3921 char v130; // [sp+1Ch] [bp-E8h]@120
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3922 POINT a2; // [sp+24h] [bp-E0h]@8
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3923 POINT v132; // [sp+2Ch] [bp-D8h]@120
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3924 POINT v133; // [sp+34h] [bp-D0h]@17
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3925 POINT v134; // [sp+3Ch] [bp-C8h]@97
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3926 POINT v135; // [sp+44h] [bp-C0h]@31
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3927 POINT v136; // [sp+4Ch] [bp-B8h]@97
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3928 POINT v137; // [sp+54h] [bp-B0h]@17
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3929 POINT v138; // [sp+5Ch] [bp-A8h]@32
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3930 POINT v139; // [sp+64h] [bp-A0h]@17
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3931 POINT v140; // [sp+6Ch] [bp-98h]@31
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3932 POINT v141; // [sp+74h] [bp-90h]@8
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3933 POINT v142; // [sp+7Ch] [bp-88h]@31
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3934 POINT v143; // [sp+84h] [bp-80h]@9
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3935 GUIWindow dialog_window; // [sp+8Ch] [bp-78h]@1
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3936 int v146; // [sp+E4h] [bp-20h]@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3937 int pYellowColor; // [sp+E8h] [bp-1Ch]@1
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3938 int pWhiteColor; // [sp+ECh] [bp-18h]@1
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3939 __int32 pItemCount; // [sp+F0h] [bp-14h]@8
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3940 int v152; // [sp+FCh] [bp-8h]@24
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3941 int v153; // [sp+100h] [bp-4h]@44
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3942 int th;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3943 short text_color;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3944 int pActiveButton;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3945
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3946 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3947 dialog_window.uFrameX = 483;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3948 dialog_window.uFrameWidth = 148;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3949 dialog_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
3950 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
3951 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3952 switch (dialog_menu_id)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3953 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3954 case HOUSE_DIALOGUE_MAIN:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3955 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3956 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3957 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3958 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3959 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3960 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3961 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3962 all_text_height = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3963 for( int i = 0; i < 4; ++i )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3964 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3965 v146 = ( 174 - all_text_height ) / 4;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3966 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3967 pNumString = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3968 if ( pDialogueWindow->pNumPresenceButton>=0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3969 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3970 for (pActiveButton = pDialogueWindow->pStartingPosActiveItem; pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++pActiveButton)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3971 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3972 pButton = pDialogueWindow->GetControl(pActiveButton);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3973 pButton->uY = v146 + v23;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3974 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3975 pButton->uHeight = pTextHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3976 v23 = pButton->uY + pButton->uHeight - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3977 pButton->uW = v23;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3978 pTextColor = pYellowColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3979 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3980 pTextColor = pWhiteColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3981 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[pNumString], 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3982 ++pNumString;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3983 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3984 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3985 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3986 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3987 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3988 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3989 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);//
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3990 textureW = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3991 v153 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3992 for ( int i = 0; i < 8; ++i )//
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3993 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3994 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3995 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3996 textureW = ItemsInShopTexture[i]->uTextureWidth;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3997 textureH = ItemsInShopTexture[i]->uTextureHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3998 if ( i >= 4 ) //low row
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
3999 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4000 v60 = 90 - (textureW/2);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4001 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4002 v59 = v60 + v153 + 80220;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4003 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4004 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4005 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4006 pY_item = 98 - textureH;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4007 v152 = 86 - (textureW/2);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4008 pRenderer->DrawTextureTransparent(v152 + v153, pY_item, ItemsInShopTexture[i]);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4009 v59 = v153 + v152 + 640 * pY_item;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4010 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4011 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4012 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4013 v153 += 105;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4014 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4015 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4016 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4017 pItemCount = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4018 for ( int i = 0; i < 8; ++i )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4019 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4020 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4021 ++pItemCount;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4022 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4023 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4024 pStatusText = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4025 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4026 pStatusText = pGlobalTXT_LocalizationStrings[185];//"Steal item"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4027 DrawTextAtStatusBar(pStatusText, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4028 if ( pItemCount != 0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4029 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4030 v73 = pMouse->GetCursorPos(&v136);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4031 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4032 if ( !v74 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4033 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4034 pItemCount = v74 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4035 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4036 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0)
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4037 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4038 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4039 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4040 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4041 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4042 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4043 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4044 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4045 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4046 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4047 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4048 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4049 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4050 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4051 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4052 v11 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4053 v61 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4054 v153 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4055 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4056 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4057 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v61].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4058 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4059 v62 = ItemsInShopTexture[v61];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4060 if ( v61 >= 4 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4061 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4062 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4063 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4064 v66 = v153 + v67 + 80220;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4065 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4066 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4067 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4068 v63 = 98 - v62->uTextureHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4069 v64 = ItemsInShopTexture[v61];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4070 v65 = 98 - v62->uTextureHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4071 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4072 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4073 v66 = v152 + v153 + 640 * v63;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4074 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4075 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v61 + 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4076 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4077 v153 += 105;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4078 ++v61;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4079 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4080 while ( v61 < 8 );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4081 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4082 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4083 v68 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4084 pItemCount = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4085 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4086 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4087 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(signed int)v68].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4088 ++pItemCount;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4089 ++v68;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4090 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4091 while ( v68 < 6 );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4092 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4093 pStatusText = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4094 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4095 pStatusText = pGlobalTXT_LocalizationStrings[185];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4096 DrawTextAtStatusBar(pStatusText, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4097 if ( (char *)pItemCount != 0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4098 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4099 v73 = pMouse->GetCursorPos(&v136);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4100 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4101 if ( !v74 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4102 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4103 pItemCount = v74 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4104 if ( dialog_menu_id == 2 )
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4105 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4106 else
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4107 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4108 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4109 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4110 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4111 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4112 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4113 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4114 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4115 return;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4116 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4117 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4118 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4119 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4120 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4121 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4122 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4123 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
4124 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4125 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4126 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4127 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4128 all_text_height = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4129 for ( int i = 0; i < 3; ++i )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4130 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4131 v152 = (174 - all_text_height) / 3;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4132 v86 = (3 * (58 - v152) - all_text_height) / 2 - v152 / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4133 v24 = -pDialogueWindow->pNumPresenceButton < 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4134 pActiveButton = pDialogueWindow->pStartingPosActiveItem;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
4135 if ( v24 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4136 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4137 pNumString = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4138 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4139 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4140 pButton = pDialogueWindow->GetControl((unsigned int)pActiveButton);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4141 pButton->uY = v152 + v86;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4142 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4143 v90 = pButton->uY;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4144 pButton->uHeight = pTextHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4145 v86 = v90 + pTextHeight - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4146 pButton->uW = v86;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4147 pTextColor = pYellowColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4148 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4149 pTextColor = pWhiteColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4150 dialog_window.DrawTitleText(pFontArrus, 0, v90, pTextColor, pShopOptions[pNumString], 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4151 ++pNumString;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4152 ++pActiveButton;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4153 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4154 while ( (signed int)pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4155 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4156 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4157 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4158 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4159 case HOUSE_DIALOGUE_SHOP_SELL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4160 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4161 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
4162 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4163 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4164 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4165 return;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4166 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4167 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4168 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4169 return;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4170 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v10 - 1];
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4171 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4172 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3)];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4173 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4174 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4175 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4176 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4177 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4178 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4179 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4180 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4181 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
4182 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4183 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4184 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4185 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4186 v1 = pMouse->GetCursorPos(&a2)->x - 14;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4187 pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4188 if ( pMouse->GetCursorPos(&v141)->x > 13 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4189 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4190 if ( pMouse->GetCursorPos(&v143)->x < 462 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4191 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4192 v2 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4193 if ( v2 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4194 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4195 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v2-1];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4196 if (v3->Identified())
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4197 v5 = "%24";
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4198 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4199 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4200 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4201 v5 = (char *)pMerchantsIdentifyPhrases[v8];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4202 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4203 v6 = BuilDialogueString(v5, uActiveCharacter - 1, v3, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4204 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4205 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v6, 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4206 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4207 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4208 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4209 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4210 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4211 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4212 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4213 case HOUSE_DIALOGUE_SHOP_REPAIR:
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4214 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4215 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
4216 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4217 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4218 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4219 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4220 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4221 pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4222 pMouse->GetCursorPos(&v140)->x <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4223 || pMouse->GetCursorPos(&v138)->x >= 462
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4224 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
4225 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4226 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4227 v116 = &pPlayers[uActiveCharacter]->pInventoryItems[v33 - 1];
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
4228 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4229 v15 = (char *)pMerchantsRepairPhrases[v35];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4230 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4231 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4232 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4233 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4234 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4235 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4236 case HOUSE_DIALOGUE_SHOP_6: //buy standart ???
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4237 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4238 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4239 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4240 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4241 return;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4242 pItemCount = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4243 for( int i = 0; i < 6 ; ++i )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4244 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4245 ++pItemCount;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4246 if ( pItemCount )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4247 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4248 v94 = pMouse->GetCursorPos(&v132);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4249 pItemCount = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4250 v95 = pItemCount;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4251 if ( pItemCount && pItemCount != -65536 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4252 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4253 --pItemCount;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4254 v97 = uActiveCharacter - 1;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4255 v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 2);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4256 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4257 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4258 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, pWhiteColor, v100, 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4259 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4260 v104 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4261 v153 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4262 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4263 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4264 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4265 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v104].uItemID)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4266 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4267 v105 = ItemsInShopTexture[v104];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4268 if ( v104 >= 4 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4269 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4270 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4271 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4272 v127 = v104 + 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4273 v109 = v153 + v110 + 80220;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4274 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4275 else
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4276 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4277 v106 = 98 - v105->uTextureHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4278 v108 = 98 - v105->uTextureHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4279 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4280 pRenderer->DrawTextureTransparent(v152 + v153, v108, ItemsInShopTexture[v104]);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4281 v127 = v104 + 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4282 v109 = v152 + v153 + 640 * v106;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4283 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4284 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4285 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4286 v153 += 105;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4287 ++v104;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4288 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4289 while ( v104 < 8 );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4290 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4291 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4292 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4293 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4294 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4295 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4296 case HOUSE_DIALOGUE_LEARN_SKILLS:
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4297 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4298 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4299 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4300 v152 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4301 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4302 pActiveButton = v38 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4303 if ( (signed int)pActiveButton < v38 / 3 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4304 pActiveButton = v38 / 3;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4305 v39 = pDialogueWindow->pStartingPosActiveItem;
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4306 v40 = pDialogueWindow->pNumPresenceButton;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4307 v153 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4308 if ( (signed int)v39 < (signed int)(v39 + v40) )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4309 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4310 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4311 {
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4312 v41 = pDialogueWindow->GetControl(v39)->msg_param - 36;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4313 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] && !pPlayers[uActiveCharacter]->pActiveSkills[v41] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4314 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4315 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4316 v152 += v42;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4317 ++v153;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4318 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4319 ++v39;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4320 }
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4321 while ( (signed int)v39 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4322 if ( v153 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4323 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4324 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pActiveButton);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4325 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4326 pActiveButton = (149 - v152) / v153;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4327 if ( (149 - v152) / v153 > 32 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4328 pActiveButton = 32;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4329 v43 = (149 - v153 * (signed int)pActiveButton - v152) / 2 - (signed int)pActiveButton / 2 + 162;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4330 v152 = pDialogueWindow->pStartingPosActiveItem;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4331 v146 = v43;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4332 if ( v152 < v152 + pDialogueWindow->pNumPresenceButton )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4333 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4334 v153 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4335 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4336 {
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4337 pButton = pDialogueWindow->GetControl(v152);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4338 v46 = pButton->msg_param - 36;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4339 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v46] || pPlayers[uActiveCharacter]->pActiveSkills[v46] )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4340 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4341 pButton->uW = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4342 pButton->uHeight = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4343 pButton->uY = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4344 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4345 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4346 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4347 pButton->uY = (unsigned int)((char *)pActiveButton + v146);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4348 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v46], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4349 v49 = pButton->uY;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4350 pButton->uHeight = pTextHeight;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4351 v51 = v49 + pTextHeight - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4352 pButton->uW = v51;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4353 v146 = v51;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4354 pTextColor = pYellowColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4355 if ( pDialogueWindow->pCurrentPosActiveItem != v153 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4356 pTextColor = pWhiteColor;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4357 dialog_window.DrawTitleText(pFontArrus, 0, v49, pTextColor, pSkillNames[v46], 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4358 }
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4359 v53 = pDialogueWindow->pStartingPosActiveItem;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4360 ++v152;
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
4361 textureH = pDialogueWindow->pNumPresenceButton + v53;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4362 ++v153;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4363 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4364 while ( v152 < textureH );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4365 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4366 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4367 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4368 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4369 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); //"Seek knowledge elsewhere %s the %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4370 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4371 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4372 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4373 dialog_window.DrawTitleText(pFontArrus, 0, v115, pYellowColor, pTmpBuf.data(), 3);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4374 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4375 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4376 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4377 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4378 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4379
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4380 //----- (004B5D7C) --------------------------------------------------------
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4381 void GuildDialog()
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4382 {
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4383 signed int base_teach_price; // ebx@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4384 int v3; // edi@6
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4385 int result; // eax@11
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4386 int v6; // esi@13
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4387 signed int v7; // esi@17
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4388 int v8; // esi@22
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4389 signed int v9; // ecx@22
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4390 char *v10; // eax@22
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4391 const char *statusbar_string; // ecx@26
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4392 POINT *v12; // esi@30
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4393 int v13; // ecx@30
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4394 void *v14; // ST1C_4@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4395 ItemGen *v15; // ST18_4@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4396 int v16; // ST10_4@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4397 int v17; // eax@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4398 char *v18; // edx@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4399 int v19; // eax@32
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4400 int pActiveItem; // esi@35
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4401 int v22; // eax@35
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4402 unsigned int v23; // eax@36
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4403 int v24; // eax@39
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4404 int v25; // eax@40
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4405 int v26; // ecx@47
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4406 GUIButton *pButton; // eax@49
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4407 unsigned int v29; // eax@49
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4408 char *pText; // eax@52
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4409 int pTextHeight; // eax@55
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4410 unsigned int v32; // ecx@55
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4411 int v33; // eax@55
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4412 unsigned __int16 pTextColor; // ax@55
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4413 int v35; // eax@58
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4414 const char *v36; // ST20_4@61
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4415 unsigned __int16 v37; // ST1C_2@61
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4416 int v38; // eax@61
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4417 int v40; // [sp-14h] [bp-300h]@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4418 int v41; // [sp-10h] [bp-2FCh]@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4419 unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4420 char *v43; // [sp-8h] [bp-2F4h]@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4421 unsigned int v44; // [sp-4h] [bp-2F0h]@31
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4422 char Dest[100]; // [sp+Ch] [bp-2E0h]@3
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4423 char v46[100]; // [sp+70h] [bp-27Ch]@3
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4424 char v47[100]; // [sp+D4h] [bp-218h]@3
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4425 char v48[100]; // [sp+138h] [bp-1B4h]@3
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4426 char v49[100]; // [sp+19Ch] [bp-150h]@3
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4427 POINT v50; // [sp+264h] [bp-88h]@30
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4428 POINT v51; // [sp+26Ch] [bp-80h]@30
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4429 GUIWindow working_window; // [sp+274h] [bp-78h]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4430 signed int v53; // [sp+27Ch] [bp-70h]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4431 signed int v54; // [sp+284h] [bp-68h]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4432 int pColorWhite; // [sp+2CCh] [bp-20h]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4433 int pColorYellow; // [sp+2D0h] [bp-1Ch]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4434 int v58; // [sp+2D4h] [bp-18h]@1
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4435 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4436 bool pSkillFlag; // [sp+2DCh] [bp-10h]@35
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4437 int v61; // [sp+2E0h] [bp-Ch]@35
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4438 int pItemNum;
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4439 unsigned int v62; // [sp+2E4h] [bp-8h]@13
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4440 int v63; // [sp+2E8h] [bp-4h]@1
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4441 int pNumActivItem;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4442 int all_text_height;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4443
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4444 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4445 working_window.uFrameX = 483;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4446 working_window.uFrameWidth = 148;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4447 working_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
4448 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
4449 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4450 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4451 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4452 if ( v63 < base_teach_price / 3 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4453 v63 = base_teach_price / 3;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4454 strcpy(Dest, "");
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4455 strcpy(v46, "");
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4456 strcpy(v47, "");
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4457 strcpy(v48, "");
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4458 strcpy(v49, "");
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4459 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4460 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4461 if ( dialog_menu_id != HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4462 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4463 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4464 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4465 if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4466 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4467 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4468 ShowStatusBarString(pTmpBuf.data(), 2);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4469 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4470 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4471 else
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4472 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4473 if ( pParty->uNumGold < v63 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4474 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4475 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold"
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4476 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4477 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4478 else
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4479 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4480 Party::TakeGold(v63);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4481 pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4482 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4483 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4484 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4485 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4486 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4487 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4488 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4489 v6 = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4490 v62 = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4491 v63 = 32;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4492 do
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4493 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4494 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4495 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4496 pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4497 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4498 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4499 v63 += 70;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4500 v62 += 280;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4501 ++v6;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4502 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4503 while ( v63 < 452 );
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4504 v62 = 1680;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4505 v7 = 6;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4506 v63 = 32;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4507 do
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4508 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4509 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4510 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4511 pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4512 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4513 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4514 v63 += 70;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4515 v62 += 280;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4516 ++v7;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4517 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4518 while ( v63 < 452 );
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4519 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4520 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4521 v8 = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4522 v9 = 12;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4523 do
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4524 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4525 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4526 ++v8;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4527 --v9;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4528 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4529 while ( v9 );
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4530 GetAsyncKeyState(17);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4531 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4532 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4533 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4534 DrawTextAtStatusBar(statusbar_string, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4535 if ( !v8 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4536 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4537 working_window.DrawCurrentTime(__PAIR__( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4538 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4539 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4540 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4541 v12 = pMouse->GetCursorPos(&v51);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4542 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4543 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4544 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4545 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4546 v14 = window_SpeakInHouse->ptr_1C;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4547 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4548 v16 = (int)window_SpeakInHouse->ptr_1C;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4549 uPlayerID = uActiveCharacter - 1;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
4550 v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, BildingType_MagicShop, v16, 2);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4551 v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4552 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4553 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorWhite, v18, 3);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4554 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4555 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4556 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4557 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4558 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4559 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits,
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4560 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4561 { //you must me member
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4562 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4563 working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3u);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4564 pDialogueWindow->pNumPresenceButton = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4565 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4566 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4567 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4568 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4569 v61 = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4570 pSkillFlag = false;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4571 pActiveItem = pDialogueWindow->pStartingPosActiveItem;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4572 v22 = pActiveItem + pDialogueWindow->pNumPresenceButton;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4573 pItemNum = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4574 if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4575 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4576 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4577 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4578 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4579 v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4580 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4581 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4582 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4583 all_text_height = 0;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4584 do
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4585 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4586 v23 = pDialogueWindow->GetControl(pActiveItem)->msg_param;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4587 if ( v23 == 18 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4588 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4589 all_text_height += pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0); //"Buy Spells"
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4590 v61++;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4591 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4592 else
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4593 {
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4594 if( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v23 - 36]
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4595 && !pPlayers[uActiveCharacter]->pActiveSkills[v23 - 36] )
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4596 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4597 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v23 - 36], &working_window, 0, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4598 v61++;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4599 pSkillFlag = true;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4600 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4601 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4602 ++pActiveItem;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4603 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4604 while ( pActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4605 if ( !v61 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4606 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4607 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4608 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4609 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4610 v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4611 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4612 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4613 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4614 if ( pSkillFlag )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4615 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4616 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4617 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4618 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4619 v58 = (149 - all_text_height) / v61;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4620 if ( v58 > 32 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4621 v58 = 32;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4622 v26 = (149 - v61 * v58 - all_text_height) / 2 - v58 / 2 + 162;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4623 pNumActivItem = pDialogueWindow->pStartingPosActiveItem;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4624 if (pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4625 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4626 pItemNum = 2;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4627 do
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4628 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4629 pButton = pDialogueWindow->GetControl(pItemNum);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4630 v29 = pButton->msg_param;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4631 if ( v29 == 18 )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4632 {
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4633 pText = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4634 pButton->uY = v58 + v26;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4635 pTextHeight = pFontArrus->CalcTextHeight(pText, &working_window, 0, 0);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4636 v32 = pButton->uY;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4637 pButton->uHeight = pTextHeight;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4638 v33 = v32 + pTextHeight - 1;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4639 pButton->uW = v33;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4640 v26 = v33;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4641 pTextColor = pColorYellow;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4642 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4643 pTextColor = pColorWhite;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4644 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pText, 3);
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4645 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4646 else
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4647 {
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4648 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36]
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4649 && !pPlayers[uActiveCharacter]->pActiveSkills[v29 - 36] )
886
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4650 {
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4651 pButton->uY = v58 + v26;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4652 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v29 - 36], &working_window, 0, 0);
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4653 v32 = pButton->uY;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4654 pButton->uHeight = pTextHeight;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4655 v33 = v32 + pTextHeight - 1;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4656 pButton->uW = v33;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4657 v26 = v33;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4658 pTextColor = pColorYellow;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4659 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4660 pTextColor = pColorWhite;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4661 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pSkillNames[v29 - 36], 3);
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4662 }
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4663 else
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4664 {
886
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4665 pButton->uW = 0;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4666 pButton->uHeight = 0;
b6573b99ca40 SalesProcess function
Ritor1
parents: 883
diff changeset
4667 pButton->uY = 0;
893
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4668 }
4676774b225c GuildDialogue fix
Ritor1
parents: 886
diff changeset
4669 }
881
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4670 ++pItemNum;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4671 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4672 while ( pItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4673 }
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4674 return;
1d7e7d61485b GuildDialog(second)
Ritor1
parents: 874
diff changeset
4675 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4676
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4677 //----- (004B705E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4678 void TempleDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4679 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4680 GUIWindow *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4681 Player *v1; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4682 int v2; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4683 int result; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4684 GUIWindow *v4; // edi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4685 void *v5; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4686 int v6; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4687 unsigned int v7; // eax@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4688 int v8; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4689 unsigned int v9; // eax@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4690 int v10; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4691 int v11; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4692 GUIWindow *v12; // ecx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4693 int v13; // edx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4694 GUIButton *v14; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4695 GUIButton *v15; // edi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4696 int v16; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4697 const char *v17; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4698 int v18; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4699 unsigned int v19; // ecx@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4700 int v20; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4701 unsigned __int16 v21; // ax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4702 unsigned __int16 v22; // ST14_2@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4703 int v23; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4704 double v24; // st7@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4705 unsigned int v25; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4706 DDM_DLV_Header *v26; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4707 int v27; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4708 int v28; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4709 //unsigned int v29; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4710 unsigned int v30; // edx@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4711 unsigned int v31; // edx@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4712 unsigned int v32; // edx@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4713 unsigned int v33; // edx@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4714 unsigned int v34; // edx@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4715 int v35; // edi@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4716 signed int v36; // eax@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4717 unsigned __int8 v37; // al@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4718 int v38; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4719 GUIWindow *v39; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4720 unsigned __int8 v40; // al@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4721 GUIButton *v41; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4722 int v42; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4723 GUIWindow *v43; // ecx@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4724 int v44; // edi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4725 int v45; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4726 signed int v46; // edi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4727 int v47; // edi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4728 GUIButton *v48; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4729 const char *v49; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4730 GUIButton *v50; // esi@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4731 int v51; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4732 unsigned int v52; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4733 unsigned __int16 v53; // ax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4734 char a1[300]; // [sp+10h] [bp-1B4h]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4735 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4736 __int64 v58; // [sp+190h] [bp-34h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4737 __int64 v59; // [sp+198h] [bp-2Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4738 __int64 v60; // [sp+1A0h] [bp-24h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4739 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4740 unsigned int v62; // [sp+1B0h] [bp-14h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4741 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4742 int v64; // [sp+1B8h] [bp-Ch]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4743 unsigned int v65; // [sp+1BCh] [bp-8h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4744 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4745
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4746 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4747 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4748 v57.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4749 v57.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4750 v57.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
4751 HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
4752 HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4753 v1 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4754 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
1036
7f8be9f9769e player recieve damage
Gloval
parents: 1033
diff changeset
4755 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[v0->par1C - 1].fPriceMultiplier);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4756 HIDWORD(v60) = v2;
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
4757 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4758 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4759 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4760 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4761 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4762 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4763 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4764 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4765 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4766 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4767 v4 = pDialogueWindow;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4768 v61 = pDialogueWindow;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4769 v5 = window_SpeakInHouse->ptr_1C;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4770 v66 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4771 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4772 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4773 v6 = v1->GetMerchant();
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4774 v64 = (signed int)(v65 * (100 - v6)) / 100;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4775 if ( v64 < (signed int)v65 / 3 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4776 v64 = (signed int)v65 / 3;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4777 v7 = v4->pStartingPosActiveItem;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4778 v8 = v7 + v4->pNumPresenceButton;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4779 v65 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4780 v62 = v7;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4781 if ( (signed int)v7 >= v8 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4782 goto LABEL_78;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4783 do
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4784 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4785 v9 = v4->GetControl(v62)->msg_param - 36;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4786 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4787 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4788 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4789 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4790 ++v65;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4791 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4792 v11 = v4->pStartingPosActiveItem;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4793 ++v62;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4794 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4795 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4796 if ( v65 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4797 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4798 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4799 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4800 v64 = (149 - (signed int)v66) / (signed int)v65;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4801 if ( v64 > 32 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4802 v64 = 32;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4803 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4804 v12 = v61;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4805 result = v61->pStartingPosActiveItem;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4806 v13 = result + v61->pNumPresenceButton;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4807 v62 = v61->pStartingPosActiveItem;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4808 if ( result < v13 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4809 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4810 v66 = (DDM_DLV_Header *)2;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4811 while ( 1 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4812 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4813 v14 = v12->GetControl(v62);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4814 v15 = v14;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4815 v16 = v14->msg_param - 36;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4816 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4817 {
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4818 v15->uW = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4819 v15->uHeight = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4820 v15->uY = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4821 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4822 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4823 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4824 v17 = pSkillNames[v16];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4825 v15->uY = v64 + v65;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4826 HIDWORD(v60) = (uint32)v17;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4827 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4828 v19 = v15->uY;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4829 v15->uHeight = v18;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4830 v20 = v19 + v18 - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4831 v15->uW = v20;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4832 v65 = v20;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4833 v21 = WORD2(v59);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4834 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4835 v21 = WORD2(v58);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4836 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4837 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4838 result = (int)v61;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4839 ++v62;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4840 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4841 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4842 break;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4843 v12 = v61;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4844 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4845 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4846 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4847 else
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4848 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4849 LABEL_78:
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4850 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4851 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4852 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4853 v22 = WORD2(v59);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4854 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v57, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
4855 v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4856 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4857 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4858 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4859 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4860 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4861 // DONATION
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4862 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4863 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4864 v25 = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4865 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4866 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4867 Party::TakeGold((signed __int64)v24);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4868 v26 = &pOutdoor->ddm;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4869 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4870 v26 = &pIndoor->dlv;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4871 v27 = v26->uReputation;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4872 v66 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4873 if ( v27 > -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4874 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4875 v28 = v27 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4876 v26->uReputation = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4877 if ( v28 < -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4878 v26->uReputation = -5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4879 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4880 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4881 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4882 if ( v26->uReputation <= -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4883 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4884 v30 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4885 LOBYTE(v30) = v30 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4886 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4887 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4888 if ( v26->uReputation <= -10 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4889 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4890 v31 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4891 LOBYTE(v31) = v31 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4892 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4893 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4894 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4895 if ( v26->uReputation <= -15 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4896 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4897 v32 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4898 LOBYTE(v32) = v32 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4899 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4900 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4901 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4902 if ( v26->uReputation <= -20 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4903 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4904 v33 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4905 LOBYTE(v33) = v33 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4906 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4907 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4908 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4909 if ( v26->uReputation <= -25 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4910 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4911 v34 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4912 LOBYTE(v34) = v34 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4913 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4914 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4915 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4916 ++byte_F8B1EF[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4917 v1->PlaySound(SPEECH_83, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4918 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4919 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4920 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4921 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4922 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4923 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4924 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4925 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4926 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4927 if ( !v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4928 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4929 v25 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4930 if ( pParty->uNumGold < v2 )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4931 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4932 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4933 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4934 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4935 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4936 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4937 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4938 v35 = LODWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4939 v59 = v1->pConditions[14];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4940 v58 = v1->pConditions[15];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4941 v60 = v1->pConditions[16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4942 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4943 memset(v1, 0, 0xA0u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4944 v1->sHealth = v1->GetMaxHealth();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4945 v1->sMana = v1->GetMaxMana();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4946 v36 = (signed int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4947 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4948 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4949 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4950 {
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4951 v37 = LOBYTE(v1->uPrevFace);
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4952 v38 = v1->uPrevVoiceID;
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4953 v1->uCurrentFace = v37;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4954 v1->uVoiceID = v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4955 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4956 }
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4957 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4958 v1->PlaySound(SPEECH_82, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4959 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4960 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4961 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4962 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4963 v39 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4964 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4965 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4966 LODWORD(v1->pConditions[17]) = v35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4967 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4968 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4969 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4970 if ( !v60 && !v58 && !v59 )
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4971 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4972 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4973 v1->PlaySound(SPEECH_82, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4974 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4975 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4976 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4977 }
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4978 v1->uPrevFace = v1->uCurrentFace;
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4979 v1->uPrevVoiceID = v1->uVoiceID;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4980 v1->SetCondition(0x11u, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4981 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4982 v40 = (v1->GetSexByVoice() != 0) + 23;
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 990
diff changeset
4983 v1->uCurrentFace = v40;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4984 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4985 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4986 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4987 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4988 HIDWORD(v1->pConditions[17]) = (int)v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4989 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4990 v1->PlaySound(SPEECH_82, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4991 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4992 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
4993 return; // void func
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4994 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4995 v63 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4996 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4997 strcpy(a1, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4998 v41->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4999 v41->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5000 if ( v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5001 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5002 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5003 v63 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5004 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5005 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5006 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5007 v42 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5008 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5009 v44 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5010 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5011 if ( v63 < pDialogueWindow->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5012 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5013 v61 = (GUIWindow *)&a1[100 * v63];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5014 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5015 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5016 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5017 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5018 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5019 v61 = (GUIWindow *)((char *)v61 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5020 ++v44;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5021 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5022 while ( v44 < pDialogueWindow->pNumPresenceButton );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5023 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5024 v46 = v43->pNumPresenceButton - v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5025 v64 = (174 - (signed int)v66) / v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5026 if ( v64 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5027 v64 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5028 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5029 v65 = v42 + v43->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5030 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5031 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5032 v61 = (GUIWindow *)(v42 + 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5033 v66 = (DDM_DLV_Header *)&a1[100 * v42];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5034 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5035 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5036 v48 = v43->GetControl(v65);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5037 v49 = (const char *)v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5038 v50 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5039 v48->uY = v64 + v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5040 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5041 v52 = v50->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5042 v50->uHeight = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5043 v47 = v52 + v51 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5044 v50->uW = v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5045 v53 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5046 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5047 v53 = WORD2(v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5048 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5049 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5050 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5051 v61 = (GUIWindow *)((char *)v61 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5052 ++v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5053 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5054 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5055 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5056 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5057 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5058
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5059 //----- (004B4710) --------------------------------------------------------
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5060 void TrainingDialog()
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5061 {
717
Ritor1
parents: 690
diff changeset
5062 //Player *v0; // ebx@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5063 int color2; // eax@1
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5064 //unsigned int v2; // ecx@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5065 //int v3; // eax@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5066 //signed int v4; // edx@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5067 unsigned __int64 v5; // edi@3
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5068 //unsigned int v6; // esi@3
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5069 //void *v7; // ecx@3
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5070 int v8; // edx@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5071 double v9; // st7@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5072 signed int v10; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5073 int v11; // ecx@6
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5074 //int result; // eax@9
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5075 GUIWindow *v13; // edi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5076 signed int v14; // esi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5077 unsigned int v15; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5078 int v16; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5079 unsigned int v17; // eax@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5080 int v18; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5081 int v19; // ecx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5082 GUIButton *v20; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5083 GUIButton *v21; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5084 int v22; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5085 const char *v23; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5086 int v24; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5087 unsigned int v25; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5088 int v26; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5089 unsigned __int16 v27; // ax@28
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5090 //int v28; // eax@32
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5091 unsigned __int16 v29; // ST14_2@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5092 int v30; // eax@34
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5093 //const char *v31; // ST18_4@36
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5094 //unsigned __int16 v32; // ST14_2@36
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5095 int v33; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5096 int v34; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5097 unsigned int v35; // edi@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5098 unsigned int v36; // eax@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5099 //int v37; // ecx@41
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5100 //char *v38; // eax@41
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5101 //int *v39; // eax@45
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5102 unsigned int v40; // eax@46
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5103 //void *v41; // ecx@46
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5104 unsigned int v42; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5105 GUIWindow *v43; // ecx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5106 int v44; // edx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5107 char **v45; // esi@60
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5108 //int v46; // eax@62
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5109 int v47; // eax@68
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5110 //int v48; // edx@69
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5111 int v49; // ebx@69
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5112 //unsigned __int8 v50; // sf@69
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5113 char **v51; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5114 GUIButton *v52; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5115 GUIButton *v53; // esi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5116 int v54; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5117 unsigned int v55; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5118 int v56; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5119 unsigned __int16 v57; // ax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5120 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5121 //const char *v59; // [sp-Ch] [bp-90h]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5122 char *v60; // [sp-8h] [bp-8Ch]@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5123 //char *v61; // [sp-8h] [bp-8Ch]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5124 unsigned int v62; // [sp-4h] [bp-88h]@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5125 int v63; // [sp-4h] [bp-88h]@52
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5126 //char *v64; // [sp-4h] [bp-88h]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5127 GUIWindow v65; // [sp+Ch] [bp-78h]@1
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5128 //__int64 v66; // [sp+60h] [bp-24h]@3
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5129 unsigned int white; // [sp+68h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5130 int v68; // [sp+6Ch] [bp-18h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5131 int v69; // [sp+70h] [bp-14h]@6
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5132 //unsigned int i; // [sp+74h] [bp-10h]@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5133 //int v71; // [sp+78h] [bp-Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5134 int v72; // [sp+7Ch] [bp-8h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5135 int v73; // [sp+80h] [bp-4h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5136
717
Ritor1
parents: 690
diff changeset
5137 //v0 = pPlayers[uActiveCharacter];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5138 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5139 v65.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5140 v65.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5141 v65.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
5142 white = TargetColor(255, 255, 255);
Nomad
parents: 948
diff changeset
5143 color2 = TargetColor(0xE1u, 0xCDu, 0x23u);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5144 //v71 = color2;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5145 //v2 = v0->uLevel;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5146 //v3 = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5147 //v4 = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5148 //for ( i = v2; v4 < (signed int)v2; ++v4 )
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5149 // v3 += v4 + 1;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5150 //v5 = 1000 * v3;
717
Ritor1
parents: 690
diff changeset
5151 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5152 //v6 = HIDWORD(v0->uExperience);
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5153 //v7 = window_SpeakInHouse->ptr_1C;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5154 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5155 //v66 = 1000 * v3;
717
Ritor1
parents: 690
diff changeset
5156 if (pPlayers[uActiveCharacter]->uExperience >= v5)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5157 {
717
Ritor1
parents: 690
diff changeset
5158 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5159 if ( v8 == 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5160 v8 = 3;
717
Ritor1
parents: 690
diff changeset
5161 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5162 //i = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5163 v69 = v8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5164 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5165 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
717
Ritor1
parents: 690
diff changeset
5166 v11 = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5167 if ( v11 < v10 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5168 v11 = v10 / 3;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5169 //i = v11;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5170 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5171
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5172 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5173 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5174 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5175 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5176 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5177 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5178 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5179 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5180 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5181 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5182 //i = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5183 int _v0 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5184 v13 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5185 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5186 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
717
Ritor1
parents: 690
diff changeset
5187 v73 = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5188 if ( v73 < v14 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5189 v73 = v14 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5190 v15 = v13->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5191 v16 = v13->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5192 v72 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5193 if ( (signed int)v15 >= (signed int)(v15 + v16) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5194 goto LABEL_76;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5195 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5196 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5197 v17 = v13->GetControl(v15)->msg_param - 36;
717
Ritor1
parents: 690
diff changeset
5198 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] && !pPlayers[uActiveCharacter]->pActiveSkills[v17] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5199 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5200 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5201 _v0 += v18;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5202 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5203 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5204 ++v15;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5205 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5206 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5207 if ( v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5208 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5209 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5210 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5211 v73 = (signed int)(149 - _v0) / v72;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5212 if ( v73 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5213 v73 = 32;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5214 //result = v13->pStartingPosActiveItem;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5215 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5216 int _v1 = v13->pStartingPosActiveItem;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5217 v68 = v19;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5218 if (v13->pStartingPosActiveItem < v13->pStartingPosActiveItem + v13->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5219 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5220 v72 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5221 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5222 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5223 v20 = v13->GetControl(_v1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5224 v21 = v20;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5225 v22 = v20->msg_param - 36;
717
Ritor1
parents: 690
diff changeset
5226 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v22] || pPlayers[uActiveCharacter]->pActiveSkills[v22] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5227 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5228 v21->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5229 v21->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5230 v21->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5231 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5232 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5233 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5234 v23 = pSkillNames[v22];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5235 v21->uY = v73 + v68;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5236 //HIDWORD(v66) = (int)v23;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5237 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5238 v25 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5239 v21->uHeight = v24;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5240 v26 = v25 + v24 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5241 v21->uW = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5242 v68 = v26;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5243 v27 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5244 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5245 v27 = white;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5246 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5247 }
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5248 ++_v1;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5249 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5250 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5251 while ( (signed int)_v1 < v13->pStartingPosActiveItem + v13->pNumPresenceButton );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5252 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5253 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5254 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5255 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5256 LABEL_76:
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5257 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5258 // "Seek knowledge elsewhere %s the %s"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5259 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5260 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5261 v29 = color2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5262 v30 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5263 v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf.data(), 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5264 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5265 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5266 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5267 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5268 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5269 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5270 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5271 //v31 = pNPCTopics[122].pText;
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5272 //v32 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5273 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5274 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, color2, pNPCTopics[122].pText, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5275 pDialogueWindow->pNumPresenceButton = 0;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5276 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5277 }
717
Ritor1
parents: 690
diff changeset
5278 v34 = pPlayers[uActiveCharacter]->uLevel;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5279 if ( v34 < v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5280 {
717
Ritor1
parents: 690
diff changeset
5281 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5282 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5283 if ( pParty->uNumGold >= v11)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5284 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5285 Party::TakeGold(v11);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5286 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
717
Ritor1
parents: 690
diff changeset
5287 ++pPlayers[uActiveCharacter]->uLevel;
Ritor1
parents: 690
diff changeset
5288 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
Ritor1
parents: 690
diff changeset
5289 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
Ritor1
parents: 690
diff changeset
5290 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5291
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5292 uint max_level_in_party = player_levels[0];
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5293 for (uint _it = 1; _it < 4; ++_it)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5294 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5295 if (player_levels[_it] > max_level_in_party)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5296 max_level_in_party = player_levels[_it];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5297 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5298
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5299 ++player_levels[uActiveCharacter - 1];
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5300 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5301 // feature is broken thou, since this array is always zeroed in EnterHouse
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5302 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5303 v40 = _494820_training_time(pParty->uCurrentHour);
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5304 //v41 = window_SpeakInHouse->ptr_1C;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5305 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5306 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5307 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5308 v42 += 720;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5309 RestAndHeal((signed int)(v42 + 10080));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5310 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5311 pOutdoor->SetFog();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5312 }
717
Ritor1
parents: 690
diff changeset
5313 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5314 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5315 // "%s is now Level %lu and has earned %lu Skill Points!"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5316 ShowStatusBarString(pTmpBuf.data(), 2);
717
Ritor1
parents: 690
diff changeset
5317 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5318 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5319 }
717
Ritor1
parents: 690
diff changeset
5320 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5321 v63 = 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5322 LABEL_55:
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
5323 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v63);
717
Ritor1
parents: 690
diff changeset
5324 //LABEL_56:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5325 /*result = pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5326 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5327 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 984
diff changeset
5328 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5329 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5330 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5331 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5332 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5333 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5334 return result;*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5335 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5336 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5337 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5338 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5339 // "You need %d more experience to train to level %d"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5340 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5341 v62 = 3;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5342 v60 = pTmpBuf.data();
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5343 v58 = color2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5344 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 88;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5345 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5346 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5347 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5348 sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5349 // ""With your skills, you should be working here as a teacher.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5350 // ""Sorry, but we are unable to train you.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5351 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5352 v62 = 3;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5353 v60 = pTmpBuf.data();
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5354 v58 = color2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5355 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 101;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5356 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5357 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5358 v63 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5359 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5360 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5361
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5362 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5363 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5364 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5365 v72 = 0;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5366 pShopOptions[0] = pTmpBuf.data();
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5367 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5368 v44 = pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5369 v73 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5370 if ( v73 < v73 + v44 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5371 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5372 v45 = pShopOptions.data();
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5373 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5374 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5375 if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5376 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5377 //v46 = pPlayers[uActiveCharacter]->uLevel;
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5378 if (pPlayers[uActiveCharacter]->uLevel >= v68)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5379 sprintfex(*v45, "%s\n \n%s",
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5380 pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]); //"With your skills, you should be working here as a teacher." "Sorry, but we are unable to train you."
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5381 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5382 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5383 if (pPlayers[uActiveCharacter]->uExperience < v5)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5384 sprintfex(*v45, pGlobalTXT_LocalizationStrings[538], // "You need %d more experience to train to level %d"
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5385 (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5386 else
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5387 sprintfex(*v45, pGlobalTXT_LocalizationStrings[537], // "Train to level %d for %d gold"
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5388 pPlayers[uActiveCharacter]->uLevel + 1, v11);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5389 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5390 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5391 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5392 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5393 v72 += v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5394 ++v45;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5395 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5396 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5397 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5398 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5399
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5400 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5401 v73 = v43->pStartingPosActiveItem;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5402 if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5403 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5404 int _v3 = 2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5405 v51 = pShopOptions.data();
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5406 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5407 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5408 v52 = v43->GetControl(v73);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5409 v53 = v52;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5410 v52->uY = (174 - v72) / 2 + v49;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5411 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5412 v55 = v53->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5413 v53->uHeight = v54;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5414 v56 = v54 + v55 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5415 v53->uW = v56;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5416 v49 = v56;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5417 v57 = color2;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5418 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5419 v57 = white;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5420 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5421 v43 = pDialogueWindow;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5422 ++_v3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5423 ++v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5424 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5425 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5426 while ( v73 < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5427 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5428 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5429 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5430 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5431
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5432 //----- (004B4FCF) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5433 void MagicShopDialog()
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5434 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5435 int result; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5436 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5437 unsigned int v3; // ebx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5438 char *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5439 char *v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5440 unsigned int v6; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5441 int v7; // ST08_4@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5442 int v8; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5443 unsigned __int8 v9; // dl@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5444 char *v10; // ecx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5445 signed int v11; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5446 int v12; // ST08_4@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5447 int v13; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5448 int all_text_height; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5449 char **v15; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5450 int v16; // eax@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5451 int v18; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5452 int v19; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5453 unsigned __int8 v20; // sf@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5454 GUIButton *control_button; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5455 const char **v22; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5456 int v23; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5457 unsigned int v24; // ecx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5458 const char **v25; // edx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5459 unsigned __int16 text_color; // ax@25
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5460 signed int pTextHeight; // esi@30
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5461 int v28; // ST08_4@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5462 int v29; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5463 char *v30; // edx@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5464 void *v32; // eax@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5465 signed int v33; // esi@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5466 unsigned int v34; // esi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5467 int v35; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5468 unsigned int v36; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5469 int v37; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5470 int v38; // ecx@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5471 int v41; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5472 char *v42; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5473 int v43; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5474 unsigned int v44; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5475 int v45; // edx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5476 int v46; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5477 unsigned __int16 v47; // ax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5478 int v48; // eax@58
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5479 signed int v49; // esi@62
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5480 Texture *v50; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5481 unsigned int v51; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5482 unsigned int v52; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5483 int v53; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5484 Texture *v54; // ecx@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5485 unsigned int v55; // edi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5486 unsigned int v56; // esi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5487 int v57; // edx@80
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5488 unsigned int v59; // edi@86
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5489 unsigned int v60; // esi@88
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5490 int v61; // edx@92
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5491 unsigned int v63; // edi@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5492 unsigned int v64; // esi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5493 int v65; // edx@104
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5494 signed int v66; // ecx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5495 SHORT v67; // di@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5496 bool v68; // eax@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5497 const char *v69; // ecx@119
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5498 POINT *v70; // esi@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5499 int v71; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5500 int v73; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5501 int v75; // eax@130
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5502 int v78; // eax@132
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5503 int v80; // edx@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5504 int v81; // edi@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5505 const char **v83; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5506 int v84; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5507 unsigned int v85; // ecx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5508 int v86; // edx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5509 int v89; // [sp-14h] [bp-10Ch]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5510 int v91; // [sp-10h] [bp-108h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5511 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5512 void *v93; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5513 int v94; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5514 char *v95; // [sp-8h] [bp-100h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5515 __int64 *v96; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5516 unsigned int v97; // [sp-4h] [bp-FCh]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5517 POINT v98; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5518 POINT v99; // [sp+14h] [bp-E4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5519 POINT v100; // [sp+1Ch] [bp-DCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5520 POINT v101; // [sp+24h] [bp-D4h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5521 POINT v102; // [sp+2Ch] [bp-CCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5522 POINT v103; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5523 POINT v104; // [sp+3Ch] [bp-BCh]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5524 POINT v105; // [sp+44h] [bp-B4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5525 POINT v106; // [sp+4Ch] [bp-ACh]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5526 POINT v107; // [sp+54h] [bp-A4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5527 POINT v108; // [sp+5Ch] [bp-9Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5528 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5529 POINT v110; // [sp+6Ch] [bp-8Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5530 POINT v111; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5531 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5532 char *Str; // [sp+D0h] [bp-28h]@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5533 int v146; // [sp+D4h] [bp-24h]@23
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5534 unsigned int pYellowColor; // [sp+D8h] [bp-20h]@1
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5535 unsigned int pWhiteColor; // [sp+DCh] [bp-1Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5536 __int32 v117; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5537 int v118; // [sp+E4h] [bp-14h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5538 const char **v119; // [sp+E8h] [bp-10h]@24
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5539 int _this; // [sp+ECh] [bp-Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5540 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5541 int v152; // [sp+F4h] [bp-4h]@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5542 int v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5543 int v114;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5544 int pSrtingNum;
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5545 int pActiveItemNum;
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5546 ItemGen *item;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5547
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5548 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5549 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5550 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5551 dialog_window.uFrameZ = 334;
949
Nomad
parents: 948
diff changeset
5552 pWhiteColor = TargetColor(255, 255, 255);
Nomad
parents: 948
diff changeset
5553 pYellowColor = TargetColor(225, 205, 35);
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5554 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5555 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5556 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5557 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5558 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5559 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5560 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5561 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5562 all_text_height = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5563 for ( int i = 0; i < 4; ++i )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5564 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5565 v146 = (174 - all_text_height) / 4;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5566 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5567 int j = 0;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5568 if ( pDialogueWindow->pNumPresenceButton>=0 )
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5569 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5570 int th = 2;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5571 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5572 {
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5573 control_button = pDialogueWindow->GetControl(v152);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5574 control_button->uY = v146 + v23;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5575 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5576 control_button->uHeight = pTextHeight;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5577 v23 = control_button->uY + control_button->uHeight - 1;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5578 control_button->uW = v23;
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5579 text_color = pYellowColor;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5580 if ( pDialogueWindow->pCurrentPosActiveItem != th )
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5581 text_color = pWhiteColor;
900
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5582 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5583 ++th;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5584 ++j;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5585 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5586 }
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5587 return;
4dc2252e0b03 CharacterUI_StatsTab_ShowHint fixed
Ritor1
parents: 898
diff changeset
5588 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5589 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5590 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5591 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5592 v3 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5593 v49 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5594 v122 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5595 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5596 {
907
f3ccfc765502 RentRoom
Ritor1
parents: 906
diff changeset
5597 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5598 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5599 v50 = ItemsInShopTexture[v49];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5600 v51 = 152 - v50->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5601 if ( (signed int)v51 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5602 v51 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5603 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5604 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5605 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5606 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5607 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5608 v53 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5609 if ( (signed int)v52 > 457 - v53 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5610 v52 = 457 - v53;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5611 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5612 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5613 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5614 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5615 if ( (signed int)v52 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5616 v52 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5617 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5618 pRenderer->DrawTextureTransparent(v52, v51, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5619 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5620 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5621 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5622 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5623 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5624 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5625 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5626 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5627 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5628 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5629 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5630 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5631 v54 = ItemsInShopTexture[v122 + 6];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5632 v55 = 306 - v54->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5633 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5634 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5635 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5636 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5637 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5638 v57 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5639 if ( (signed int)v56 > 457 - v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5640 v56 = 457 - v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5641 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5642 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5643 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5644 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5645 if ( (signed int)v56 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5646 v56 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5647 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5648 pRenderer->DrawTextureTransparent(v56, v55, v54);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5649 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5650 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5651 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5652 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5653 while ( v122 < 6 );
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5654 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5655 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5656 v66 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5657 v117 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5658 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5659 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5660 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5661 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5662 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5663 ++v117;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5664 ++v66;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5665 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5666 while ( v66 < 12 );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5667 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5668 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5669 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5670 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5671 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5672 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5673 ++v117;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5674 ++v66;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5675 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5676 while ( v66 < 12 );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5677 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5678 v67 = GetAsyncKeyState(VK_CONTROL);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5679 v68 = pPlayers[uActiveCharacter]->CanSteal();
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5680 Str = (char *)v68;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5681 if ( v67 && v68 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5682 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5683 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5684 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5685 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5686 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5687 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5688 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5689 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5690 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5691 DrawTextAtStatusBar(v69, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5692 if ( !v117 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5693 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5694 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5695 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5696 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5697 v70 = pMouse->GetCursorPos(&v102);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5698 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5699 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5700 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5701 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5702 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5703 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5704 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5705 if ( v67 && Str )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5706 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5707 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5708 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5709 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5710 v10 = (char *)pMerchantsBuyPhrases[v75];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5711 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5712 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5713 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5714 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5715 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5716 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5717 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5718 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5719 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5720 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5721 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5722 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5723 v3 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5724 v49 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5725 v122 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5726 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5727 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5728 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5729 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5730 v59 = 152 - ItemsInShopTexture[v49]->uTextureHeight;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5731 if ( (signed int)v59 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5732 v59 = 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5733 v60 = 75 * v49 - ItemsInShopTexture[v49]->uTextureWidth / 2 + 40;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5734 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5735 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5736 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5737 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5738 v61 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5739 if ( (signed int)v60 > 457 - v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5740 v60 = 457 - v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5741 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5742 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5743 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5744 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5745 if ( (signed int)v60 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5746 v60 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5747 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5748 pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5749 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5750 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5751 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5752 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5753 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5754 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5755 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5756 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5757 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5758 {
917
ae9e2a339b09 disappear items fix
Ritor1
parents: 912
diff changeset
5759 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5760 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5761 v63 = 306 - ItemsInShopTexture[v122 + 6]->uTextureHeight;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5762 if ( (signed int)v63 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5763 v63 = 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5764 v64 = 75 * v122 - ItemsInShopTexture[v122 + 6]->uTextureWidth / 2 + 40;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5765 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5766 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5767 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5768 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5769 v65 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5770 if ( (signed int)v64 > 457 - v65 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5771 v64 = 457 - v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5772 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5773 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5774 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5775 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5776 if ( (signed int)v64 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5777 v64 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5778 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5779 pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5780 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5781 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5782 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5783 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5784 while ( v122 < 6 );
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5785 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5786 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5787 v66 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5788 v117 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5789 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5790 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5791 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5792 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5793 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5794 ++v117;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5795 ++v66;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5796 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5797 while ( v66 < 12 );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5798 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5799 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5800 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5801 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5802 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5803 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5804 ++v117;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5805 ++v66;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5806 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5807 while ( v66 < 12 );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5808 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5809 v67 = GetAsyncKeyState(VK_CONTROL);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5810 v68 = pPlayers[uActiveCharacter]->CanSteal();
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5811 Str = (char *)v68;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5812 if ( v67 && v68 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5813 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5814 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5815 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5816 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5817 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5818 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5819 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5820 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5821 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5822 DrawTextAtStatusBar(v69, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5823 if ( !v117 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5824 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5825 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5826 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5827 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5828 v70 = pMouse->GetCursorPos(&v102);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5829 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5830 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5831 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5832 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5833 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5834 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5835 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5836 if ( v67 && Str )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5837 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5838 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5839 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5840 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5841 v10 = (char *)pMerchantsBuyPhrases[v75];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5842 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5843 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5844 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5845 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5846 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5847 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5848 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5849 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5850 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5851 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5852 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5853 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
5854 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5855 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5856 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5857 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5858 all_text_height = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5859 for ( uint i = 0; i < 3; ++i )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5860 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5861 _this = ((174 - all_text_height) / 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5862 v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5863 v20 = -pDialogueWindow->pNumPresenceButton < 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5864 v118 = pDialogueWindow->pStartingPosActiveItem;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1104
diff changeset
5865 if ( v20 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5866 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5867 v122 = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5868 pSrtingNum = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5869 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5870 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5871 control_button = pDialogueWindow->GetControl(v118);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5872 control_button->uY = (unsigned int)((char *)_this + v81);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5873 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5874 v85 = control_button->uY;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5875 control_button->uHeight = pTextHeight;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5876 v81 = pTextHeight + v85 - 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5877 control_button->uW = v81;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5878 text_color = pYellowColor;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5879 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5880 text_color = pWhiteColor;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5881 dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5882 ++v122;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5883 ++pSrtingNum;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5884 ++v118;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5885 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5886 while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5887 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5888 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5889 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5890 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5891 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5892 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
5893 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5894 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5895 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5896 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5897 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5898 result = (int)pMouse->GetCursorPos(&v105),
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5899 *(int *)result <= 13)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5900 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5901 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5902 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5903 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5904 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5905 v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5906 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5907 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5908 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5909 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5910 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5911 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5912 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
5913 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5914 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5915 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5916 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5917 v2 = pMouse->GetCursorPos(&a2)->x - 14;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5918 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5919 result = (int)pMouse->GetCursorPos(&v111);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5920 if ( *(int *)result > 13 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5921 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5922 result = (int)pMouse->GetCursorPos(&v103);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5923 if ( *(int *)result < 462 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5924 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5925 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5926 if ( result )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5927 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5928 item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5929 if ( item->uAttributes & 1 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5930 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5931 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5932 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5933 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5934 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5935 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5936 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5937 v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5938 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5939 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5940 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5941 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5942 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5943 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5944 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5945 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5946 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5947 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5948 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5949 draw_leather();
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 978
diff changeset
5950 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5951 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5952 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5953 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14,
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5954 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5955 result = (int)pMouse->GetCursorPos(&v106),
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5956 *(int *)result <= 13)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5957 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5958 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
5959 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
5960 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5961 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5962 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5963 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5964 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5965 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5966 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5967 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5968 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5969 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5970 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5971 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5972 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5973 v3 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5974 all_text_height = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5975 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5976 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5977 if ( (signed int)v119 < v33 / 3 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5978 v119 = (const char **)(v33 / 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5979 pActiveItemNum = pDialogueWindow->pStartingPosActiveItem;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5980 v122 = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5981 if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5982 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5983 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5984 // "Seek knowledge elsewhere %s the %s"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5985 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5986 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5987 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
5988 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5989 return;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5990 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5991 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5992 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5993 v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5994 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5995 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5996 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5997 ++v122;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5998 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
5999 ++pActiveItemNum;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6000 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6001 while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6002 if ( !v122 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6003 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6004 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6005 // "Seek knowledge elsewhere %s the %s"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6006 strcat(pTmpBuf.data(), "\n \n");
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6007 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6008 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6009 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6010 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6011 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6012 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
6013 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6014 v119 = (const char **)((149 - all_text_height) / v122);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6015 if ( (149 - all_text_height) / v122 > 32 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6016 v119 = (const char **)32;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6017 v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6018 v118 = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6019 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6020 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6021 v122 = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6022 do
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6023 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6024 control_button = pDialogueWindow->GetControl(v122);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6025 v41 = control_button->msg_param - 36;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6026 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6027 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6028 control_button->uW = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6029 control_button->uHeight = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6030 control_button->uY = 0;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6031 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6032 else
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6033 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6034 control_button->uY = (unsigned int)((char *)v119 + v38);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6035 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6036 v44 = control_button->uY;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6037 control_button->uHeight = pTextHeight;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6038 v38 = v44 + pTextHeight - 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6039 control_button->uW = v38;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6040 text_color = pYellowColor;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6041 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6042 text_color = pWhiteColor;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6043 dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6044 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6045 ++v122;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6046 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6047 while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6048 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6049 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 917
diff changeset
6050 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6051 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6052 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6053 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6054
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6055
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6056 //----- (004B6478) --------------------------------------------------------
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6057 void sub_4B6478()
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6058 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6059 GUIWindow *v0; // ebx@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6060 Player *v1; // edi@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6061 unsigned int v2; // eax@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6062 signed int v3; // esi@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6063 int v4; // ebx@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6064 unsigned int v5; // esi@5
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6065 int v6; // edi@6
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6066 int result; // eax@13
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6067 GUIWindow *v8; // ebx@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6068 int v9; // eax@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6069 int v10; // ecx@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6070 unsigned int v11; // ecx@18
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6071 int v12; // eax@20
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6072 int v13; // eax@21
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6073 GUIButton *v14; // esi@27
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6074 int v15; // ecx@27
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6075 unsigned int v16; // eax@28
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6076 const char *v17; // ebx@29
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6077 int v18; // eax@29
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6078 unsigned int v19; // ecx@29
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6079 int v20; // eax@29
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6080 unsigned __int16 v21; // ax@29
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6081 unsigned __int16 v22; // ST14_2@36
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6082 int v23; // eax@36
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6083 const char *v24; // ST18_4@37
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6084 unsigned __int16 v25; // ST14_2@37
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6085 int v26; // eax@37
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6086 int v27; // [sp-4h] [bp-80h]@8
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6087 GUIWindow v28; // [sp+Ch] [bp-70h]@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6088 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6089 unsigned int v30; // [sp+64h] [bp-18h]@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6090 int v31; // [sp+68h] [bp-14h]@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6091 int v32; // [sp+6Ch] [bp-10h]@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6092 int v33; // [sp+70h] [bp-Ch]@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6093 int v34; // [sp+74h] [bp-8h]@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6094 int v35; // [sp+78h] [bp-4h]@17
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6095
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6096 v0 = window_SpeakInHouse;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6097 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6098 v1 = pPlayers[uActiveCharacter];
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6099 v28.uFrameX = 483;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6100 v28.uFrameWidth = 148;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6101 v28.uFrameZ = 334;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6102 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6103 v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6104 v2 = 52 * (unsigned int)v0->ptr_1C;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6105 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6106 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6107 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6108 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6109 v4 = v3 * (100 - v1->GetMerchant()) / 100;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6110 v32 = v4;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6111 if ( v4 < v3 / 3 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6112 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6113 v4 = v3 / 3;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6114 v32 = v3 / 3;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6115 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6116 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6117 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6118 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6119 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6120 v5 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6121
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6122 __debugbreak();
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6123 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6124 // or
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6125 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6126 // or
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6127 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6128 __debugbreak(); // whacky condition - fix
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6129 if (false
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6130 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6131 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6132 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6133 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6134 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6135 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6136 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6137 if ( pParty->uNumGold < v4 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6138 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6139 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6140 v27 = 4;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6141 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6142 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6143 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6144 Party::TakeGold(v4);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6145 *(short *)v6 = 1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6146 v27 = 2;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6147 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6148 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6149 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6150 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6151 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6152 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6153 v5 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6154 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6155 /*result = pMessageQueue_50CBD0->uNumMessages;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6156 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6157 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6158 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6159 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6160 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6161 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6162 ++pMessageQueue_50CBD0->uNumMessages;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6163 }*/
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6164 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6165 return; // void func
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6166 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6167 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6168 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6169 v24 = pNPCTopics[171].pText;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6170 v25 = v31;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6171 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6172 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6173 pDialogueWindow->pNumPresenceButton = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6174 return ;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6175 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6176
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6177 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6178 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6179 v8 = pDialogueWindow;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6180 v33 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6181 v34 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6182 v29 = pDialogueWindow;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6183 v9 = pDialogueWindow->pStartingPosActiveItem;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6184 v10 = v9 + pDialogueWindow->pNumPresenceButton;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6185 v35 = pDialogueWindow->pStartingPosActiveItem;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6186 if ( v9 >= v10 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6187 goto LABEL_40;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6188 do
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6189 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6190 v11 = v8->GetControl(v35)->msg_param - 36;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6191 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6192 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6193 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6194 v33 += v12;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6195 ++v34;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6196 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6197 v13 = v8->pStartingPosActiveItem;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6198 ++v35;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6199 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6200 while ( v35 < v8->pNumPresenceButton + v13 );
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6201 if ( !v34 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6202 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6203 LABEL_40:
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6204 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6205 strcat(pTmpBuf.data(), "\n \n");
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6206 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6207 v22 = v31;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6208 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6209 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6210 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6211 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6212 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6213 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6214 v32 = (149 - v33) / v34;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6215 if ( (149 - v33) / v34 > 32 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6216 v32 = 32;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6217
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6218 v35 = v8->pStartingPosActiveItem;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6219 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6220 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6221 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6222 v33 = 2;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6223 do
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6224 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6225 v14 = v8->GetControl(v35);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6226 v15 = v14->msg_param - 36;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6227 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6228 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6229 v16 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6230 if ( !v1->pActiveSkills[v15] )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6231 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6232 v17 = pSkillNames[v15];
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6233 v14->uY = v32 + v34;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6234 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6235 v19 = v14->uY;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6236 v14->uHeight = v18;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6237 v20 = v19 + v18 - 1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6238 v14->uW = v20;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6239 v34 = v20;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6240 v21 = v31;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6241 if ( pDialogueWindow->pCurrentPosActiveItem != v33 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6242 v21 = v30;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6243 v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u);
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6244 goto LABEL_34;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6245 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6246 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6247 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6248 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6249 v16 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6250 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6251 v14->uW = v16;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6252 v14->uHeight = v16;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6253 v14->uY = v16;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6254 LABEL_34:
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6255 v8 = v29;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6256 ++v35;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6257 ++v33;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6258 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6259 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6260 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6261 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1207
diff changeset
6262 }