1298
|
1 #ifdef _MSC_VER
|
|
2 #define _CRT_SECURE_NO_WARNINGS
|
|
3 #endif
|
|
4
|
1299
|
5 #include "..\Texture.h"
|
|
6 #include "..\mm7_data.h"
|
1298
|
7 #include "UIHouses.h"
|
1299
|
8 #include "..\Party.h"
|
|
9 #include "..\texts.h"
|
|
10 #include "..\Events.h"
|
|
11 #include "..\Arcomage.h"
|
|
12 #include "..\LOD.h"
|
|
13 #include "..\Mouse.h"
|
|
14 #include "..\GUIWindow.h"
|
|
15 #include "..\GUIFont.h"
|
|
16 #include "..\Events2D.h"
|
|
17 #include "..\Overlays.h"
|
|
18 #include "..\Outdoor.h"
|
|
19 #include "..\AudioPlayer.h"
|
|
20 #include "..\VideoPlayer.h"
|
|
21 #include "..\Monsters.h"
|
|
22 #include "..\Viewport.h"
|
|
23 #include "..\Keyboard.h"
|
|
24 #include "..\IndoorCamera.h"
|
|
25 #include "..\MapInfo.h"
|
|
26 #include "..\Log.h"
|
|
27 #include "..\Game.h"
|
1298
|
28
|
1299
|
29 #include "..\stru159.h"
|
1298
|
30 int uHouse_ExitPic; // weak
|
|
31
|
|
32 int dword_591080; // weak
|
|
33
|
|
34 int in_current_building_type; // 00F8B198
|
|
35 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
|
|
36
|
|
37 #pragma pack(push, 1)
|
|
38 struct stru365_travel_info
|
|
39 {
|
|
40 unsigned char uMapInfoID;
|
|
41 unsigned char pSchedule[7];
|
|
42 unsigned int uTravelTime;
|
|
43 int arrival_x;
|
|
44 int arrival_y;
|
|
45 int arrival_z;
|
|
46 int arrival_rot_y;
|
|
47 unsigned int uQuestBit; // quest bit required to set for this travel option to be enabled; otherwise 0
|
|
48 };
|
|
49 #pragma pack(pop)
|
|
50 stru365_travel_info transport_schedule[35] = // 004F09B0
|
|
51 {
|
|
52 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
|
|
53 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
|
|
54 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
|
|
55 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
|
|
56 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
|
|
57 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
|
|
58 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
|
|
59 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
|
|
60 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
|
|
61 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
|
|
62 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
|
|
63 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
|
|
64 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
|
|
65 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
|
|
66 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
|
|
67 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
|
|
68 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
|
|
69 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
|
|
70 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 7, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
71 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
|
|
72 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
|
|
73 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
|
|
74 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
|
|
75 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
|
|
76 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
|
|
77 {MAP_EVENMORN_ISLE, {0, 1, 0, 1, 0, 0, 0}, 1, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
78 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
|
|
79 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
|
|
80 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
|
|
81 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 5, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
82 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
|
|
83 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
|
|
84 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
|
|
85 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
|
|
86 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
|
|
87 };
|
|
88
|
|
89 unsigned char transport_routes[20][4] =
|
|
90 {
|
|
91 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
|
|
92 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
|
|
93 { 6, 7, 8, 8}, // HOUSE_STABLES_56
|
|
94 { 9, 10, 10, 10}, // HOUSE_STABLES_57
|
|
95 { 11, 11, 12, 12}, // HOUSE_STABLES_58
|
|
96 { 13, 13, 13, 13}, // HOUSE_STABLES_59
|
|
97 { 14, 14, 15, 15}, // HOUSE_STABLES_60
|
|
98 {255, 255, 255, 255}, // HOUSE_STABLES_61
|
|
99 {255, 255, 255, 255}, // HOUSE_STABLES_62
|
|
100 {255, 255, 255, 255}, // HOUSE_BOATS_63
|
|
101 { 16, 17, 18, 19}, // HOUSE_BOATS_64
|
|
102 { 18, 20, 21, 21}, // HOUSE_BOATS_65
|
|
103 { 22, 23, 24, 25}, // HOUSE_BOATS_66
|
|
104 { 22, 22, 23, 23}, // HOUSE_BOATS_67
|
|
105 {255, 255, 255, 255}, // HOUSE_BOATS_68
|
|
106 { 27, 28, 29, 30}, // HOUSE_BOATS_69
|
|
107 { 31, 32, 33, 33}, // HOUSE_BOATS_70
|
|
108 { 24, 24, 24, 24}, // HOUSE_BOATS_71
|
|
109 {255, 255, 255, 255}, // HOUSE_BOATS_72
|
|
110 {255, 255, 255, 255} // HOUSE_BOATS_73
|
|
111 };
|
|
112
|
|
113
|
|
114
|
|
115
|
|
116
|
|
117 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70
|
|
118 {{
|
|
119 {"", 0x4, 0x1F4, 0, 0, 0},
|
|
120 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
|
|
121 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
|
|
122 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
|
|
123 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
|
|
124 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
|
|
125 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
|
|
126 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
|
|
127 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
|
|
128 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
|
|
129 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
|
|
130 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
|
|
131 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
|
|
132 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
|
|
133 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
|
|
134 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
|
|
135 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
|
|
136 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
|
|
137 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
|
|
138 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
|
|
139 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
|
|
140 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
|
|
141 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
|
|
142 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
|
|
143 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
|
|
144 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
|
|
145 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
|
|
146 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
|
|
147 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
|
|
148 {"", 0x21, 0x2F0, 27, 91, 3 },
|
|
149 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
|
|
150 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
|
|
151 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
|
|
152 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
|
|
153 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
|
|
154 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
|
|
155 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
|
|
156 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
|
|
157 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
|
|
158 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
|
|
159 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
|
|
160 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
|
|
161 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
|
|
162 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
|
|
163 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
|
|
164 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
|
|
165 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
|
|
166 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
|
|
167 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
|
|
168 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
|
|
169 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
|
|
170 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
|
|
171 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
|
|
172 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
|
|
173 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
|
|
174 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
|
|
175 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
|
|
176 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
|
|
177 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
|
|
178 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
|
|
179 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
|
|
180 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
|
|
181 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
|
|
182 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
|
|
183 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
|
|
184 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
|
|
185 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
|
|
186 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
|
|
187 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
|
|
188 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
|
|
189 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
|
|
190 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
|
|
191 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
|
|
192 {"Human Poor House 1", 8, 0, 29, 0, 0 },
|
|
193 {"Human Poor House 2", 8, 0, 29, 0, 0 },
|
|
194 {"Human Poor House 3", 8, 0, 29, 0, 0 },
|
|
195 {"Human Medium House 1", 8, 0, 29, 0, 0 },
|
|
196 {"Human Medium House 2", 8, 0, 29, 0, 0 },
|
|
197 {"Human Medium House 3", 8, 0, 29, 0, 0 },
|
|
198 {"Human Rich House 1", 8, 0, 29, 0, 0 },
|
|
199 {"Human Rich House 2", 8, 0, 29, 0, 0 },
|
|
200 {"Human Rich House 3", 8, 0, 29, 0, 0 },
|
|
201 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
|
|
202 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
|
|
203 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
|
|
204 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
|
|
205 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
|
|
206 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
|
|
207 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
|
|
208 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
|
|
209 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
|
|
210 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
|
|
211 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
|
|
212 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
|
|
213 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
|
|
214 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
|
|
215 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
|
|
216 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
|
|
217 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
|
|
218 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
|
|
219 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
|
|
220 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
|
|
221 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
|
|
222 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
|
|
223 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
|
|
224 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
225 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
|
|
226 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
|
|
227 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
|
|
228 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
|
|
229 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
|
|
230 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
|
|
231 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
|
|
232 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
|
|
233 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
234 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
|
|
235 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
|
|
236 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
|
|
237 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
|
|
238 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
|
|
239 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
|
|
240 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
|
|
241 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
|
|
242 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
243 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
|
|
244 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
|
|
245 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
|
|
246 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
|
|
247 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
|
|
248 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
|
|
249 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
|
|
250 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
|
|
251 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
|
|
252 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
|
|
253 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
|
|
254 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
|
|
255 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
|
|
256 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
|
|
257 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
|
|
258 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
|
|
259 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
|
|
260 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
|
|
261 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
|
|
262 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
|
|
263 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
|
|
264 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
|
|
265 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
|
|
266 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
|
|
267 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
|
|
268 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
|
|
269 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
|
|
270 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
|
|
271 {"", 0x24, 0, 25, 0, 0 },
|
|
272 {"", 0x24, 0, 25, 0, 0 },
|
|
273 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
|
|
274 {"", 0x24, 0, 25, 0, 0 },
|
|
275 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
|
|
276 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
|
|
277 {"", 0x24, 0, 25, 0, 0 },
|
|
278 {"", 0x24, 0, 25, 0, 0 },
|
|
279 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
|
|
280 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
|
|
281 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
|
|
282 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
|
|
283 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
|
|
284 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
|
|
285 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
|
|
286 {"Jail", 0x24, 0, 31, 0, 0 },
|
|
287 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
|
|
288 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
|
|
289 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
|
|
290 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
|
|
291 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
|
|
292 {"Master Thief", 0x24, 0, 29, 0, 0 },
|
|
293 {"Dwarven King", 0x24, 0, 20, 0, 0 },
|
|
294 {"Arms Master", 0x24, 0, 29, 0, 0 },
|
|
295 {"Warlock", 0x24, 0, 29, 0, 0 },
|
|
296 {"Lord Markam", 0x24, 0, 20, 0, 0 },
|
|
297 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
|
|
298 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
|
|
299 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
|
|
300 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
|
|
301 {"", 0x24, 0, 29, 0, 0 },
|
|
302 {"", 0x24, 0, 29, 0, 0 },
|
|
303 {"", 0x24, 0, 29, 0, 0 },
|
|
304 {"", 0x24, 0, 29, 0, 0 },
|
|
305 {"Boat01", 0xF, 0, 29, 53, 3 },
|
|
306 {"", 0x24, 0, 28, 0, 0 },
|
|
307 {"", 0x24, 0, 28, 0, 0 },
|
|
308 {"", 0x24, 0, 28, 0, 0 },
|
|
309 {"", 0x24, 0, 29, 0, 0 },
|
|
310 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
|
|
311 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
|
|
312 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
|
|
313 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
|
|
314 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
|
|
315 }};
|
|
316
|
1393
|
317
|
|
318 //----- (004B1784) --------------------------------------------------------
|
|
319 bool __cdecl HouseUI_CheckIfPlayerCanInteract()
|
|
320 {
|
|
321 Player *pPlayer; // ebx@1
|
|
322 bool result; // eax@2
|
|
323 int v3; // eax@3
|
|
324 GUIWindow v4; // [sp+4h] [bp-54h]@3
|
|
325
|
|
326 pPlayer = pPlayers[uActiveCharacter];
|
|
327 if ( pPlayer->CanAct() )
|
|
328 {
|
|
329 pDialogueWindow->pNumPresenceButton = dword_F8B1E0;
|
|
330 result = 1;
|
|
331 }
|
|
332 else
|
|
333 {
|
|
334 pDialogueWindow->pNumPresenceButton = 0;
|
|
335 memcpy(&v4, pPrimaryWindow, sizeof(v4));
|
|
336 v4.uFrameX = 483;
|
|
337 v4.uFrameWidth = 148;
|
|
338 v4.uFrameZ = 334;
|
|
339 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);//
|
|
340 // "%s is in no condition to %s"
|
|
341 // "do anything"
|
|
342 v3 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v4, 0, 0);
|
|
343 v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, ui_house_player_cant_interact_color, pTmpBuf.data(), 3u);
|
|
344 result = 0;
|
|
345 }
|
|
346 return result;
|
|
347 }
|
|
348
|
1298
|
349 //----- (0044622E) --------------------------------------------------------
|
|
350 bool EnterHouse(enum HOUSE_ID uHouseID)
|
|
351 {
|
|
352 //enum HOUSE_ID v1; // edi@1
|
|
353 //int v2; // edi@5
|
|
354 signed int uOpenTime; // eax@5
|
|
355 signed int uCloseTime; // esi@5
|
|
356 unsigned int v5; // esi@5
|
|
357 int v6; // edx@5
|
|
358 signed int am_pm_flag_open; // ecx@10
|
|
359 signed int am_pm_flag_close; // eax@10
|
|
360 int v9; // esi@10
|
|
361 //unsigned int v10; // esi@16
|
|
362 int v11; // ecx@17
|
|
363 unsigned int v12; // kr00_4@25
|
|
364 //Player *v13; // esi@25
|
|
365 int v14; // eax@25
|
|
366 //Player *v15; // esi@27
|
|
367 //signed int v16; // eax@32
|
|
368 unsigned int v17; // eax@37
|
|
369 signed int v18; // edi@37
|
|
370 signed int v19; // edi@41
|
|
371 //unsigned int v20; // ecx@41
|
|
372 //const char *v22; // [sp-4h] [bp-40h]@33
|
|
373 char pContainer[40]; // [sp+Ch] [bp-30h]@32
|
|
374 unsigned int v24; // [sp+34h] [bp-8h]@5
|
|
375 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
|
|
376
|
|
377 //v1 = uHouseID;
|
|
378 //v25 = uHouseID;
|
|
379 GameUI_Footer_TimedString[0] = 0;
|
|
380 pFooterString[0] = 0;
|
|
381 ShowStatusBarString("", 2u);
|
|
382 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
383 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
|
384 viewparams->bRedrawGameUI = 1;
|
|
385 uDialogueType = 0;
|
|
386 pKeyActionMap->SetWindowInputStatus(3);
|
|
387 pKeyActionMap->ResetKeys();
|
|
388 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
|
|
389 {
|
|
390 GameOverMenu(0);
|
|
391 return 0;
|
|
392 }
|
|
393 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
|
|
394 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
|
|
395 current_npc_text = 0;
|
|
396 dword_F8B1E4 = 0;
|
|
397 dword_F8B1F4 = 0;
|
|
398 memset(byte_F8B1F0.data(), 0, 4);
|
|
399 memset(player_levels.data(), 0, 16);
|
|
400 pRenderer->ClearZBuffer(0, 479);
|
|
401
|
|
402 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
|
|
403 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
|
|
404
|
|
405 {
|
|
406 am_pm_flag_open = 0;
|
|
407 am_pm_flag_close = 0;
|
|
408 if (uOpenTime > 12 )
|
|
409 {
|
|
410 uOpenTime -= 12;
|
|
411 am_pm_flag_open = 1;
|
|
412 }
|
|
413 if ( uCloseTime > 12 )
|
|
414 {
|
|
415 uCloseTime -= 12;
|
|
416 am_pm_flag_close = 1;
|
|
417 }
|
|
418 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
|
|
419 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
|
|
420 ShowStatusBarString(pTmpBuf.data(), 2u);
|
|
421 if ( uActiveCharacter )
|
|
422 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
|
|
423 return 0;
|
|
424 }
|
|
425 else
|
|
426 {
|
|
427 //v10 = uHouseID;
|
|
428 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
|
|
429 {
|
|
430 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
|
|
431 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
|
|
432 {
|
|
433 pParty->field_3C._shop_ban_times[uHouseID] = 0;
|
|
434 }
|
|
435 else
|
|
436 {
|
|
437 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
|
|
438 return 0;
|
|
439 }
|
|
440 }
|
|
441 pAudioPlayer->StopChannels(-1, -1);
|
|
442
|
|
443 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
|
|
444 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
|
|
445 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
|
|
446 {
|
|
447 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
|
|
448 uHouseID = HOUSE_JAIL;
|
|
449 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
|
|
450 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
|
|
451 ++pParty->uNumPrisonTerms;
|
|
452 pParty->uFine = 0;
|
|
453 for (uint i = 0; i < 4; ++i)
|
|
454 {
|
|
455 pParty->pPlayers[i].uTimeToRecovery = 0;
|
|
456 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
|
|
457 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
|
|
458 }
|
|
459 }
|
|
460 ++pIcons_LOD->uTexturePacksCount;
|
|
461 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
462 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
463 switch (pParty->alignment)
|
|
464 {
|
|
465 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
|
|
466 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
|
|
467 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
|
|
468 default: assert(false);
|
|
469 }
|
|
470
|
|
471 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
|
|
472 pDialogueNPCCount = 0;
|
|
473 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
|
|
474 uTextureID_right_panel_loop = uTextureID_right_panel;
|
|
475 PrepareHouse(uHouseID);
|
|
476 v18 = 1;
|
|
477 uTextureID_right_panel_loop = uTextureID_right_panel;
|
|
478 if ( uNumDialogueNPCPortraits == 1 )
|
|
479 pDialogueNPCCount = 1;
|
|
480 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
|
|
481 dword_5C35D4 = 1;
|
|
482 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
|
|
483 {
|
|
484 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
|
|
485 {
|
|
486 return 1;
|
|
487 }
|
|
488 }
|
|
489 else
|
|
490 { //guilds
|
|
491 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
|
|
492 //v20 = uHouseID;
|
|
493 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
|
|
494 if(_449B57_test_bit(pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
|
|
495 {
|
|
496 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
|
|
497 return 1;
|
|
498 }
|
|
499 }
|
|
500 PlayHouseSound(uHouseID, HouseSound_Greeting);
|
|
501 dword_5C35D4 = 1;
|
|
502 return 1;
|
|
503 }
|
|
504 }
|
|
505
|
1300
|
506 //----- (0044606A) --------------------------------------------------------
|
|
507 void PrepareHouse(HOUSE_ID house)
|
|
508 {
|
|
509 //unsigned int v1; // ebx@1
|
|
510 //signed int v2; // esi@1
|
|
511 //int uExitPic; // edi@1
|
|
512 __int16 uExitMapID; // ax@2
|
|
513 //int result; // eax@5
|
|
514 //unsigned int *v6; // ecx@8
|
|
515 int v7; // ebx@11
|
|
516 //int v8; // esi@16
|
|
517 //unsigned int v9; // eax@16
|
|
518 //unsigned int v10; // eax@19
|
|
519 //int v11; // ecx@19
|
|
520 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
|
|
521 int v13; // [sp+30h] [bp-30h]@11
|
|
522 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1
|
|
523 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
|
|
524 int uAnimationID; // [sp+50h] [bp-10h]@1
|
|
525 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
|
|
526 //unsigned int v18; // [sp+58h] [bp-8h]@1
|
|
527 //int v19; // [sp+5Ch] [bp-4h]@7
|
|
528
|
|
529
|
|
530 uAnimationID = p2DEvents[house - 1].uAnimationID;
|
|
531 memset(npc_id_arr, 0, sizeof(npc_id_arr));
|
|
532 uNumDialogueNPCPortraits = 0;
|
|
533 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
|
|
534 if ( uHouse_ExitPic )
|
|
535 {
|
|
536 uExitMapID = p2DEvents[house - 1]._quest_related;
|
|
537 if ( uExitMapID > 0 )
|
|
538 {
|
|
539 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
|
|
540 {
|
|
541 uHouse_ExitPic = 0;
|
|
542 }
|
|
543 }
|
|
544 }
|
|
545
|
|
546 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id;
|
|
547 HouseNPCData[0]=0;
|
|
548 uNumDialogueNPCPortraits = 0;
|
|
549 if ( dword_591080 )
|
|
550 {
|
|
551
|
|
552 npc_id_arr[0] = dword_591080;
|
|
553 uNumDialogueNPCPortraits = 1;
|
|
554 }
|
|
555
|
|
556 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i)
|
|
557 {
|
|
558 if (pNPCStats->pNewNPCData[i].Location2D == house )
|
|
559 {
|
|
560 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80))
|
|
561 {
|
1313
|
562 HouseNPCData[uNumDialogueNPCPortraits+1-((dword_591080 != 0) ? 1 : 0) ] = &pNPCStats->pNewNPCData[i];
|
1300
|
563 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID;
|
|
564 ++uNumDialogueNPCPortraits;
|
|
565 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2)
|
|
566 ++pNPCStats->pNewNPCData[i].uFlags;
|
|
567 }
|
|
568 }
|
|
569
|
|
570 }
|
|
571
|
|
572 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
|
|
573 {
|
|
574
|
|
575 char icon_name[128];
|
|
576 sprintfex(icon_name, "npc%03u", npc_id_arr[i]);
|
|
577 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
|
|
578 }
|
|
579
|
|
580 if (uHouse_ExitPic)
|
|
581 {
|
|
582 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
|
|
583 ++uNumDialogueNPCPortraits;
|
|
584 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
|
|
585 }
|
|
586 }
|
1298
|
587 //----- (004B1E92) --------------------------------------------------------
|
|
588 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
|
|
589 {
|
|
590 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
|
|
591 if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId )
|
|
592 pAudioPlayer->PlaySound(
|
|
593 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
|
|
594 (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)),
|
|
595 806, 0, -1, 0, 0, 0, 0);
|
|
596 }
|
|
597
|
|
598 //----- (004BCACC) --------------------------------------------------------
|
|
599 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
|
|
600 {
|
|
601 //unsigned int v1; // edi@1
|
|
602 //signed int v2; // ebx@1
|
|
603 //signed int v3; // ecx@2
|
|
604 int v4; // eax@5
|
|
605 signed int v5; // esi@5
|
|
606 //Player *v6; // ecx@5
|
|
607 //signed int v7; // edx@5
|
|
608 GUIWindow *v8; // esi@10
|
|
609 unsigned int v9; // eax@12
|
|
610 int v10; // esi@31
|
|
611 int v11; // edi@31
|
|
612 int v12; // esi@32
|
|
613 __int16 v13; // bp@32
|
|
614 int v14; // edx@32
|
|
615 GUIWindow *v15; // eax@32
|
|
616 int v16; // eax@32
|
|
617 int v17; // eax@33
|
|
618 int v18; // eax@34
|
|
619 int v19; // eax@35
|
|
620 __int16 v20; // ax@37
|
|
621 __int16 v21; // ax@76
|
|
622 __int16 v22; // ax@107
|
|
623 __int16 v23; // ax@132
|
|
624 __int16 v24; // ax@163
|
|
625 int v25; // esi@190
|
|
626 __int16 v26; // ax@190
|
|
627 char v27; // zf@190
|
|
628 Player *v28; // edi@192
|
|
629 int v29; // eax@204
|
|
630 void *v30; // esi@208
|
|
631 unsigned __int64 v31; // qax@208
|
|
632 signed int v32; // edi@209
|
|
633 int v33; // eax@210
|
|
634 unsigned int v34; // eax@211
|
|
635 //Player *v35; // edi@227
|
|
636 signed int v36; // esi@227
|
|
637 int v37; // ecx@227
|
|
638 int v38; // esi@230
|
|
639 int v39; // edx@235
|
|
640 int v40; // edi@243
|
|
641 unsigned __int64 v41; // qax@243
|
|
642 //void *v42; // eax@244
|
|
643 signed int v43; // edi@244
|
|
644 int v44; // edx@244
|
|
645 int v45; // eax@246
|
|
646 unsigned int v46; // eax@247
|
|
647 void *v47; // eax@250
|
|
648 signed int v48; // edi@250
|
|
649 int v49; // eax@252
|
|
650 int v50; // eax@256
|
|
651 unsigned int v51; // eax@257
|
|
652 void *v52; // eax@260
|
|
653 signed int v53; // edi@260
|
|
654 int v54; // eax@262
|
|
655 //signed int v55; // [sp+10h] [bp-10h]@1
|
|
656 int v56; // [sp+14h] [bp-Ch]@31
|
|
657
|
|
658 //v1 = 0;
|
|
659 //v2 = a1;
|
|
660 //v55 = a1;
|
|
661 if ( !pDialogueWindow->pNumPresenceButton )
|
|
662 return;
|
|
663 pRenderer->ClearZBuffer(0, 479);
|
|
664 //v3 = dword_F8B198;
|
|
665 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
|
|
666 v8 = window_SpeakInHouse;
|
|
667 //else
|
|
668 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
|
|
669 {
|
|
670 if ( in_current_building_type == BildingType_Training )
|
|
671 {
|
|
672 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
673 {
|
|
674 v4 = 0;
|
|
675 v5 = 0;
|
|
676 //v6 = pPlayers[uActiveCharacter];
|
|
677 //v7 = pPlayers[uActiveCharacter]->uLevel;
|
|
678 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
|
|
679 {
|
|
680 do
|
|
681 v4 += v5++ + 1;
|
|
682 while ( v5 < pPlayers[uActiveCharacter]->uLevel );
|
|
683 }
|
|
684 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
|
|
685 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
|
|
686 return;
|
|
687 }
|
|
688 pDialogueWindow->Release();
|
|
689 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
|
|
690 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
|
|
691 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
|
|
692 pDialogueWindow->CreateButton(8, 8, 0x1C2, 0x140, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
|
|
693 // LABEL_10:
|
|
694 //v3 = dword_F8B198;
|
|
695 v8 = window_SpeakInHouse;
|
|
696 }
|
|
697 //else
|
|
698 if ( in_current_building_type != BildingType_Training )
|
|
699 {
|
|
700 v8 = window_SpeakInHouse;
|
|
701 if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
|
|
702 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
|
|
703 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
|
|
704 {
|
|
705 //LABEL_9:
|
|
706 pDialogueWindow->Release();
|
|
707 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
|
|
708 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
|
|
709 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
|
|
710 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
|
|
711 // LABEL_10:
|
|
712 //v3 = dword_F8B198;
|
|
713 v8 = window_SpeakInHouse;
|
|
714 }
|
|
715 else if (uActiveCharacter)
|
|
716 {
|
|
717 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
|
|
718 return;
|
|
719 v8 = window_SpeakInHouse;
|
|
720 }
|
|
721 }
|
|
722 //LABEL_11:
|
|
723 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
724 if ( in_current_building_type < BildingType_19 )
|
|
725 {
|
|
726 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
|
|
727 //v3 = dword_F8B198;
|
|
728 ShopTexture = &pIcons_LOD->pTextures[v9];
|
|
729 //LABEL_13:
|
|
730 v8 = window_SpeakInHouse;
|
|
731 }
|
|
732 }
|
|
733
|
|
734 //NEW
|
|
735 switch(in_current_building_type)
|
|
736 {
|
|
737 case BildingType_FireGuild:
|
|
738 case BildingType_AirGuild:
|
|
739 case BildingType_WaterGuild:
|
|
740 case BildingType_EarthGuild:
|
|
741 case BildingType_SpiritGuild:
|
|
742 case BildingType_MindGuild:
|
|
743 case BildingType_BodyGuild:
|
|
744 case BildingType_LightGuild:
|
|
745 case BildingType_DarkGuild:
|
|
746 case BildingType_14:
|
|
747 case BildingType_15:
|
|
748 case BildingType_16:
|
|
749 {
|
|
750 if ( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472] >= (signed __int64)pParty->uTimePlayed &&
|
|
751 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468] >= (signed __int64)pParty->uTimePlayed )
|
|
752 {
|
|
753 v32 = 0;
|
|
754 do
|
|
755 {
|
|
756 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
|
|
757 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
|
|
758 if ( v33 )
|
|
759 {
|
|
760 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
|
|
761 v8 = window_SpeakInHouse;
|
|
762 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
|
|
763 }
|
|
764 ++v32;
|
|
765 }
|
|
766 while ( v32 < 12 );
|
|
767 }
|
|
768 else
|
|
769 {
|
|
770 SpellBookGenerator();
|
|
771 v30 = window_SpeakInHouse->ptr_1C;
|
|
772 v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
|
|
773 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
774 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
|
|
775 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
|
|
776 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
|
|
777 }
|
|
778 //return;
|
|
779 break;
|
|
780 }
|
|
781 case BildingType_TownHall:
|
|
782 {
|
|
783 if ( uMessageParam == 99 )
|
|
784 {
|
|
785 v10 = (int)((char *)v8->ptr_1C - 102);
|
|
786 v56 = v10;
|
|
787 v11 = 8 * v10 + 11325428;
|
|
788 if ( pParty->field_3C.field_0[2 * v10 + 1] >= (signed __int64)pParty->uTimePlayed
|
|
789 && pParty->field_3C.field_0[2 * v10] >= (signed __int64)pParty->uTimePlayed )
|
|
790 {
|
|
791 v13 = 0;
|
|
792 }
|
|
793 else
|
|
794 {
|
|
795 v12 = v10;
|
|
796 v13 = 0;
|
|
797 pParty->field_75A[v12] = 0;
|
|
798 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
|
|
799 v14 = rand() % 258;
|
|
800 v15 = window_SpeakInHouse;
|
|
801 pParty->field_750[v12] = v14 + 1;
|
|
802 v16 = (int)((char *)v15->ptr_1C - 102);
|
|
803 if ( v16 )
|
|
804 {
|
|
805 v17 = v16 - 1;
|
|
806 if ( v17 )
|
|
807 {
|
|
808 v18 = v17 - 1;
|
|
809 if ( v18 )
|
|
810 {
|
|
811 v19 = v18 - 1;
|
|
812 if ( v19 )
|
|
813 {
|
|
814 if ( v19 == 1 )
|
|
815 {
|
|
816 while ( 1 )
|
|
817 {
|
|
818 v20 = pParty->field_750[v12];
|
|
819 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
|
|
820 {
|
|
821 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
|
|
822 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
|
|
823 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
|
|
824 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
|
|
825 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
|
|
826 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
|
|
827 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
|
|
828 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
|
|
829 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
|
|
830 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
|
|
831 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
|
|
832 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
|
|
833 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
|
|
834 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
|
|
835 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
|
|
836 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
|
|
837 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
|
|
838 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
|
|
839 break;
|
|
840 }
|
|
841 pParty->field_750[v12] = rand() % 258 + 1;
|
|
842 }
|
|
843 }
|
|
844 }
|
|
845 else
|
|
846 {
|
|
847 while ( 1 )
|
|
848 {
|
|
849 v21 = pParty->field_750[v12];
|
|
850 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
|
|
851 {
|
|
852 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
|
|
853 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
|
|
854 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
|
|
855 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
|
|
856 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
|
|
857 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
|
|
858 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
|
|
859 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
|
|
860 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
|
|
861 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
|
|
862 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
|
|
863 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
|
|
864 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
|
|
865 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
|
|
866 break;
|
|
867 }
|
|
868 pParty->field_750[v12] = rand() % 258 + 1;
|
|
869 }
|
|
870 }
|
|
871 }
|
|
872 else
|
|
873 {
|
|
874 while ( 1 )
|
|
875 {
|
|
876 v22 = pParty->field_750[v12];
|
|
877 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
|
|
878 {
|
|
879 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
|
|
880 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
|
|
881 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
|
|
882 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
|
|
883 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
|
|
884 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
|
|
885 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
|
|
886 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
|
|
887 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
|
|
888 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
|
|
889 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
|
|
890 break;
|
|
891 }
|
|
892 pParty->field_750[v12] = rand() % 258 + 1;
|
|
893 }
|
|
894 }
|
|
895 }
|
|
896 else
|
|
897 {
|
|
898 while ( 1 )
|
|
899 {
|
|
900 v23 = pParty->field_750[v12];
|
|
901 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
|
|
902 {
|
|
903 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
|
|
904 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
|
|
905 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
|
|
906 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
|
|
907 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
|
|
908 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
|
|
909 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
|
|
910 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
|
|
911 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
|
|
912 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
|
|
913 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
|
|
914 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
|
|
915 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
|
|
916 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
|
|
917 break;
|
|
918 }
|
|
919 pParty->field_750[v12] = rand() % 258 + 1;
|
|
920 }
|
|
921 }
|
|
922 }
|
|
923 else
|
|
924 {
|
|
925 while ( 1 )
|
|
926 {
|
|
927 v24 = pParty->field_750[v12];
|
|
928 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
|
|
929 {
|
|
930 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
|
|
931 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
|
|
932 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
|
|
933 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
|
|
934 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
|
|
935 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
|
|
936 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
|
|
937 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
|
|
938 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
|
|
939 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
|
|
940 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
|
|
941 break;
|
|
942 }
|
|
943 pParty->field_750[v12] = rand() % 258 + 1;
|
|
944 }
|
|
945 }
|
|
946 v10 = v56;
|
|
947 }
|
|
948 v25 = v10;
|
|
949 v26 = pParty->field_750[v25];
|
|
950 v27 = pParty->field_75A[v25] == v13;
|
|
951 word_F8B1A0 = pParty->field_750[v25];
|
|
952 if ( v27 )
|
|
953 {
|
|
954 //v1 = 0;
|
|
955 v27 = v26 == v13;
|
|
956 v29 = (int)pNPCTopics[351].pText;
|
|
957 if ( v27 )
|
|
958 v29 = (int)pNPCTopics[353].pText;
|
|
959 dword_F8B1A4 = (char *)v29;
|
|
960 }
|
|
961 else
|
|
962 {
|
|
963 if ( v26 != v13 )
|
|
964 {
|
|
965 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
|
|
966 v28 = pParty->pPlayers;
|
|
967 do
|
|
968 {
|
|
969 v28->SetVariable(VAR_Award, 86);
|
|
970 ++v28;
|
|
971 }
|
|
972 while ( (signed int)v28 < (signed int)pParty->pHirelings );
|
|
973 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
|
|
974 pParty->field_750[v25] = v13;
|
|
975 pParty->field_75A[v25] = v13;
|
|
976 }
|
|
977 //v1 = 0;
|
|
978 dword_F8B1A4 = pNPCTopics[352].pText;
|
|
979 }
|
|
980 }
|
|
981 else if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_100 )
|
|
982 {
|
|
983 pKeyActionMap->EnterText(1, 10, v8);
|
|
984 }
|
|
985 break;
|
|
986 }
|
|
987 case BildingType_Bank:
|
|
988 {
|
|
989 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
|
|
990 pKeyActionMap->EnterText(1, 10, v8);
|
|
991 return;
|
|
992 break;
|
|
993 }
|
|
994 case BildingType_WeaponShop:
|
|
995 case BildingType_ArmorShop:
|
|
996 case BildingType_MagicShop:
|
|
997 case BildingType_AlchemistShop:
|
|
998 case BildingType_Tavern:
|
|
999 case BildingType_Temple:
|
|
1000 case BildingType_Training:
|
|
1001 {
|
|
1002 break;
|
|
1003 }
|
|
1004 default:
|
|
1005 {
|
|
1006 return;
|
|
1007 break;
|
|
1008 }
|
|
1009 }
|
|
1010
|
|
1011 /*
|
|
1012 if ( in_current_building_type > BildingType_Tavern )
|
|
1013 {
|
|
1014 if ( in_current_building_type == BildingType_Bank )
|
|
1015 {
|
|
1016 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
|
|
1017 pKeyActionMap->EnterText(1, 10, v8);
|
|
1018 return;
|
|
1019 }
|
|
1020 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
|
|
1021 return;
|
|
1022 }
|
|
1023 //else
|
|
1024 if ( in_current_building_type < BildingType_Tavern )
|
|
1025 {
|
|
1026 if (in_current_building_type <= 0)
|
|
1027 return;
|
|
1028 if ( in_current_building_type > BildingType_AlchemistShop )
|
|
1029 {
|
|
1030 if ( in_current_building_type <= BildingType_16 )
|
|
1031 {
|
|
1032 if ( (signed __int64)__PAIR__(
|
|
1033 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
|
|
1034 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
|
|
1035 {
|
|
1036 v32 = 0;
|
|
1037 do
|
|
1038 {
|
|
1039 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
|
|
1040 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
|
|
1041 if ( v33 )
|
|
1042 {
|
|
1043 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1044 v8 = window_SpeakInHouse;
|
|
1045 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
|
|
1046 }
|
|
1047 ++v32;
|
|
1048 }
|
|
1049 while ( v32 < 12 );
|
|
1050 }
|
|
1051 else
|
|
1052 {
|
|
1053 SpellBookGenerator();
|
|
1054 v30 = window_SpeakInHouse->ptr_1C;
|
|
1055 v31 = pParty->uTimePlayed
|
|
1056 + (signed __int64)((double)(0xA8C000
|
|
1057 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
1058 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
|
|
1059 * 0.033333335);
|
|
1060 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
|
|
1061 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
|
|
1062 }
|
|
1063 return;
|
|
1064 }
|
|
1065 if ( in_current_building_type != BildingType_TownHall )
|
|
1066 return;
|
|
1067 if ( in_current_building_type == BildingType_TownHall )
|
|
1068 {
|
|
1069 if ( uMessageParam == 99 )
|
|
1070 {
|
|
1071 v10 = (int)((char *)v8->ptr_1C - 102);
|
|
1072 v56 = v10;
|
|
1073 v11 = 8 * v10 + 11325428;
|
|
1074 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
|
|
1075 {
|
|
1076 v13 = 0;
|
|
1077 }
|
|
1078 else
|
|
1079 {
|
|
1080 v12 = v10;
|
|
1081 v13 = 0;
|
|
1082 pParty->field_75A[v12] = 0;
|
|
1083 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
|
|
1084 v14 = rand() % 258;
|
|
1085 v15 = window_SpeakInHouse;
|
|
1086 pParty->field_750[v12] = v14 + 1;
|
|
1087 v16 = (int)((char *)v15->ptr_1C - 102);
|
|
1088 if ( v16 )
|
|
1089 {
|
|
1090 v17 = v16 - 1;
|
|
1091 if ( v17 )
|
|
1092 {
|
|
1093 v18 = v17 - 1;
|
|
1094 if ( v18 )
|
|
1095 {
|
|
1096 v19 = v18 - 1;
|
|
1097 if ( v19 )
|
|
1098 {
|
|
1099 if ( v19 == 1 )
|
|
1100 {
|
|
1101 while ( 1 )
|
|
1102 {
|
|
1103 v20 = pParty->field_750[v12];
|
|
1104 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
|
|
1105 {
|
|
1106 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
|
|
1107 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
|
|
1108 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
|
|
1109 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
|
|
1110 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
|
|
1111 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
|
|
1112 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
|
|
1113 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
|
|
1114 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
|
|
1115 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
|
|
1116 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
|
|
1117 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
|
|
1118 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
|
|
1119 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
|
|
1120 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
|
|
1121 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
|
|
1122 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
|
|
1123 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
|
|
1124 break;
|
|
1125 }
|
|
1126 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1127 }
|
|
1128 }
|
|
1129 }
|
|
1130 else
|
|
1131 {
|
|
1132 while ( 1 )
|
|
1133 {
|
|
1134 v21 = pParty->field_750[v12];
|
|
1135 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
|
|
1136 {
|
|
1137 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
|
|
1138 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
|
|
1139 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
|
|
1140 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
|
|
1141 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
|
|
1142 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
|
|
1143 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
|
|
1144 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
|
|
1145 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
|
|
1146 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
|
|
1147 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
|
|
1148 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
|
|
1149 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
|
|
1150 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
|
|
1151 break;
|
|
1152 }
|
|
1153 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1154 }
|
|
1155 }
|
|
1156 }
|
|
1157 else
|
|
1158 {
|
|
1159 while ( 1 )
|
|
1160 {
|
|
1161 v22 = pParty->field_750[v12];
|
|
1162 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
|
|
1163 {
|
|
1164 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
|
|
1165 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
|
|
1166 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
|
|
1167 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
|
|
1168 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
|
|
1169 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
|
|
1170 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
|
|
1171 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
|
|
1172 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
|
|
1173 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
|
|
1174 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
|
|
1175 break;
|
|
1176 }
|
|
1177 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1178 }
|
|
1179 }
|
|
1180 }
|
|
1181 else
|
|
1182 {
|
|
1183 while ( 1 )
|
|
1184 {
|
|
1185 v23 = pParty->field_750[v12];
|
|
1186 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
|
|
1187 {
|
|
1188 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
|
|
1189 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
|
|
1190 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
|
|
1191 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
|
|
1192 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
|
|
1193 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
|
|
1194 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
|
|
1195 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
|
|
1196 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
|
|
1197 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
|
|
1198 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
|
|
1199 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
|
|
1200 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
|
|
1201 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
|
|
1202 break;
|
|
1203 }
|
|
1204 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1205 }
|
|
1206 }
|
|
1207 }
|
|
1208 else
|
|
1209 {
|
|
1210 while ( 1 )
|
|
1211 {
|
|
1212 v24 = pParty->field_750[v12];
|
|
1213 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
|
|
1214 {
|
|
1215 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
|
|
1216 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
|
|
1217 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
|
|
1218 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
|
|
1219 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
|
|
1220 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
|
|
1221 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
|
|
1222 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
|
|
1223 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
|
|
1224 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
|
|
1225 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
|
|
1226 break;
|
|
1227 }
|
|
1228 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1229 }
|
|
1230 }
|
|
1231 v10 = v56;
|
|
1232 }
|
|
1233 v25 = v10;
|
|
1234 v26 = pParty->field_750[v25];
|
|
1235 v27 = pParty->field_75A[v25] == v13;
|
|
1236 word_F8B1A0 = pParty->field_750[v25];
|
|
1237 if ( v27 )
|
|
1238 {
|
|
1239 //v1 = 0;
|
|
1240 v27 = v26 == v13;
|
|
1241 v29 = (int)pNPCTopics[351].pText;
|
|
1242 if ( v27 )
|
|
1243 v29 = (int)pNPCTopics[353].pText;
|
|
1244 dword_F8B1A4 = (char *)v29;
|
|
1245 }
|
|
1246 else
|
|
1247 {
|
|
1248 if ( v26 != v13 )
|
|
1249 {
|
|
1250 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
|
|
1251 v28 = pParty->pPlayers;
|
|
1252 do
|
|
1253 {
|
|
1254 v28->SetVariable(VAR_Award, 86);
|
|
1255 ++v28;
|
|
1256 }
|
|
1257 while ( (signed int)v28 < (signed int)pParty->pHirelings );
|
|
1258 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
|
|
1259 pParty->field_750[v25] = v13;
|
|
1260 pParty->field_75A[v25] = v13;
|
|
1261 }
|
|
1262 //v1 = 0;
|
|
1263 dword_F8B1A4 = pNPCTopics[352].pText;
|
|
1264 }
|
|
1265 }
|
|
1266 else if ( uMessageParam == 100 )
|
|
1267 {
|
|
1268 pKeyActionMap->EnterText(1, 10, v8);
|
|
1269 }
|
|
1270 }
|
|
1271 }
|
|
1272 }
|
|
1273 */
|
|
1274
|
|
1275
|
|
1276 //LABEL_196:
|
|
1277 switch ( uMessageParam )
|
|
1278 {
|
|
1279 case HOUSE_DIALOGUE_LEARN_SKILLS:
|
|
1280 {
|
|
1281 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1282 UI_CreateEndConversationButton();
|
|
1283 FillAviableSkillsToTeach(in_current_building_type);
|
|
1284 break;
|
|
1285 }
|
|
1286 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
|
|
1287 {
|
|
1288 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1289 UI_CreateEndConversationButton();
|
|
1290 sub_4B3A72(in_current_building_type);
|
|
1291 break;
|
|
1292 }
|
|
1293 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
|
|
1294 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
|
|
1295 {
|
|
1296 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
1297 break;
|
|
1298 }
|
|
1299 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
|
|
1300 {
|
|
1301 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
1302 {
|
|
1303 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_PlayArcomage;
|
|
1304 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
|
|
1305 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
|
|
1306 ++pMessageQueue_50CBD0->uNumMessages;
|
|
1307 }*/
|
|
1308 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
|
|
1309 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
|
|
1310 break;
|
|
1311 }
|
|
1312 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
|
|
1313 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
|
|
1314 {
|
|
1315 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
|
|
1316 {
|
|
1317 GenerateStandartShopItems();
|
|
1318 GenerateSpecialShopItems();
|
|
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);
|
|
1320 }
|
|
1321 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
|
|
1322 {
|
|
1323 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1324 {
|
|
1325 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
|
|
1326 {
|
|
1327 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID )
|
|
1328 {
|
|
1329 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1330 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
|
|
1331 }
|
|
1332 }
|
|
1333 }
|
|
1334 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1335 {
|
|
1336 v48 = 0;
|
|
1337 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1338 {
|
|
1339 do
|
|
1340 {
|
|
1341 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v48].uItemID)
|
|
1342 word_F8B158[v48] = rand() % (300 - ItemsInShopTexture[v48]->uTextureHeight);
|
|
1343 ++v48;
|
|
1344 }
|
|
1345 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] );
|
|
1346 }
|
|
1347 }
|
|
1348 }
|
|
1349 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
|
|
1350 {
|
|
1351 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1352 {
|
|
1353 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
|
|
1354 {
|
|
1355 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID )
|
|
1356 {
|
|
1357 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1358 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
|
|
1359 }
|
|
1360 }
|
|
1361 }
|
|
1362 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1363 {
|
|
1364 v53 = 0;
|
|
1365 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1366 {
|
|
1367 do
|
|
1368 {
|
|
1369 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v53].uItemID)
|
|
1370 word_F8B158[v53] = rand() % (300 - ItemsInShopTexture[v53]->uTextureHeight);
|
|
1371 ++v53;
|
|
1372 }
|
|
1373 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType ] );
|
|
1374 }
|
|
1375 }
|
|
1376 }
|
|
1377 break;
|
|
1378 }
|
|
1379 case HOUSE_DIALOGUE_SHOP_SELL:
|
|
1380 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
|
|
1381 case HOUSE_DIALOGUE_SHOP_REPAIR:
|
|
1382 {
|
|
1383 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
1385 break;
|
|
1386 }
|
|
1387 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
|
|
1388 {
|
|
1389 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1390 UI_CreateEndConversationButton();
|
|
1391 sub_4B3AD4(in_current_building_type);
|
|
1392 break;
|
|
1393 }
|
|
1394 default:
|
|
1395 {
|
|
1396 if( uMessageParam >= HOUSE_DIALOGUE_36 && uMessageParam <= HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
|
|
1397 {
|
|
1398 //v35 = pPlayers[uActiveCharacter];
|
|
1399 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
|
|
1400 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
|
|
1401 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
1402 if ( v37 < v36 / 3 )
|
|
1403 v37 = v36 / 3;
|
|
1404 //if (false)
|
|
1405 if(byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][uMessageParam-36])
|
|
1406 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
|
|
1407 {
|
|
1408 //v38 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + uMessageParam);
|
|
1409 if ( !pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] )
|
|
1410 {
|
|
1411 if ( pParty->uNumGold < v37 )
|
|
1412 {
|
|
1413 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
|
|
1414 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
|
|
1415 v39 = 4;
|
|
1416 else
|
|
1417 v39 = 2;
|
|
1418 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
|
|
1419 }
|
|
1420 else
|
|
1421 {
|
|
1422 Party::TakeGold(v37);
|
|
1423 dword_F8B1E4 = 1;
|
|
1424 pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] = 1;
|
|
1425 pPlayers[uActiveCharacter]->PlaySound(SPEECH_78, 0);
|
|
1426 }
|
|
1427 }
|
|
1428 }
|
|
1429 }
|
|
1430 break;
|
|
1431 }
|
|
1432 }
|
|
1433 /*
|
|
1434 if ( uMessageParam != 95 && uMessageParam != 2 )
|
|
1435 {
|
|
1436 if ( uMessageParam == 3 )
|
|
1437 {
|
|
1438 dialog_menu_id = 3;
|
|
1439 }
|
|
1440 else
|
|
1441 {
|
|
1442 if ( uMessageParam == 4 )
|
|
1443 {
|
|
1444 dialog_menu_id = 4;
|
|
1445 }
|
|
1446 else
|
|
1447 {
|
|
1448 if ( uMessageParam != 5 )
|
|
1449 {
|
|
1450 if ( uMessageParam > 35 )
|
|
1451 {
|
|
1452 if ( uMessageParam <= 72 )
|
|
1453 {
|
|
1454 v35 = pPlayers[uActiveCharacter];
|
|
1455 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
|
|
1456 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
|
|
1457 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
1458 if ( v37 < v36 / 3 )
|
|
1459 v37 = v36 / 3;
|
|
1460
|
|
1461 __debugbreak();
|
|
1462 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
|
|
1463 // or
|
|
1464 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
|
|
1465 // or
|
|
1466 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
|
|
1467
|
|
1468 if (false)
|
|
1469 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
|
|
1470 {
|
|
1471 v38 = (int)(&v35->uIntelligence + uMessageParam);
|
|
1472 if ( !*(short *)v38 )
|
|
1473 {
|
|
1474 if ( pParty->uNumGold < v37 )
|
|
1475 {
|
|
1476 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
1477 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
|
|
1478 v39 = 4;
|
|
1479 else
|
|
1480 v39 = 2;
|
|
1481 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
|
|
1482 }
|
|
1483 else
|
|
1484 {
|
|
1485 Party::TakeGold(v37);
|
|
1486 dword_F8B1E4 = 1;
|
|
1487 *(short *)v38 = 1;
|
|
1488 v35->PlaySound(SPEECH_78, 0);
|
|
1489 }
|
|
1490 }
|
|
1491 }
|
|
1492 }
|
|
1493 else
|
|
1494 {
|
|
1495 if ( uMessageParam == 94 )
|
|
1496 {
|
|
1497 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1498 UI_CreateEndConversationButton();
|
|
1499 sub_4B3AD4(in_current_building_type);
|
|
1500 }
|
|
1501 }
|
|
1502 }
|
|
1503 return;
|
|
1504 }
|
|
1505 dialog_menu_id = 5;
|
|
1506 }
|
|
1507 }
|
|
1508 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
1509 return;
|
|
1510 }
|
|
1511 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
|
|
1512 {
|
|
1513 GenerateStandartShopItems();
|
|
1514 GenerateSpecialShopItems();
|
|
1515 v8 = window_SpeakInHouse;
|
|
1516 v40 = window_SpeakInHouse->par1C;
|
|
1517 //v3 = dword_F8B198;
|
|
1518 v41 = pParty->uTimePlayed
|
|
1519 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
1520 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
|
|
1521 * 0.033333335);
|
|
1522 pParty->field_3C.field_50[v40] = v41;
|
|
1523
|
|
1524 }
|
|
1525 v42 = v8->ptr_1C;
|
|
1526 v43 = 0;
|
|
1527 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
|
|
1528 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
|
|
1529 if ( uMessageParam == 2 )
|
|
1530 {
|
|
1531 if ( uItemsAmountPerShopType[v44] )
|
|
1532 {
|
|
1533 do
|
|
1534 {
|
|
1535 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
|
|
1536 if ( v45 )
|
|
1537 {
|
|
1538 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1539 //v3 = dword_F8B198;
|
|
1540 v8 = window_SpeakInHouse;
|
|
1541 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
|
|
1542 }
|
|
1543 v42 = v8->ptr_1C;
|
|
1544 ++v43;
|
|
1545 }
|
|
1546 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1547 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1548 }
|
|
1549 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1550 {
|
|
1551 v47 = v8->ptr_1C;
|
|
1552 v48 = 0;
|
|
1553 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
|
|
1554 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
|
|
1555 {
|
|
1556 do
|
|
1557 {
|
|
1558 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
|
|
1559 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
|
|
1560 {
|
|
1561 v49 = rand();
|
|
1562 v8 = window_SpeakInHouse;
|
|
1563 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
|
|
1564 }
|
|
1565 v47 = v8->ptr_1C;
|
|
1566 ++v48;
|
|
1567 }
|
|
1568 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1569 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1570 }
|
|
1571 }
|
|
1572 }
|
|
1573 if ( uMessageParam == 95 )
|
|
1574 {
|
|
1575 if ( uItemsAmountPerShopType[v44] )
|
|
1576 {
|
|
1577 do
|
|
1578 {
|
|
1579 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
|
|
1580 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
|
|
1581 if ( v50 )
|
|
1582 {
|
|
1583 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1584 //v3 = dword_F8B198;
|
|
1585 v8 = window_SpeakInHouse;
|
|
1586 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
|
|
1587 }
|
|
1588 v42 = v8->ptr_1C;
|
|
1589 ++v43;
|
|
1590 }
|
|
1591 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1592 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1593 }
|
|
1594 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1595 {
|
|
1596 v52 = v8->ptr_1C;
|
|
1597 v53 = 0;
|
|
1598 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
|
|
1599 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
|
|
1600 {
|
|
1601 do
|
|
1602 {
|
|
1603 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
|
|
1604 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
|
|
1605 {
|
|
1606 v54 = rand();
|
|
1607 v8 = window_SpeakInHouse;
|
|
1608 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
|
|
1609 }
|
|
1610 v52 = v8->ptr_1C;
|
|
1611 ++v53;
|
|
1612 }
|
|
1613 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1614 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
|
|
1615 }
|
|
1616 }
|
|
1617 }
|
|
1618 */
|
|
1619 }
|
|
1620 //----- (004B6943) --------------------------------------------------------
|
|
1621 void __cdecl TravelByTransport()
|
|
1622 {
|
|
1623 GUIWindow *v0; // ebx@1
|
|
1624 Player *v1; // esi@1
|
|
1625 signed int v2; // edi@1
|
|
1626 unsigned int v3; // eax@1
|
|
1627 signed int v4; // ebx@1
|
|
1628 stru365_travel_info *v5; // esi@7
|
|
1629 //int v6; // eax@9
|
|
1630 //int v7; // eax@9
|
|
1631 //int v8; // eax@12
|
|
1632 //int v9; // edi@12
|
|
1633 //int v10; // edx@12
|
|
1634 int v11; // ecx@12
|
|
1635 signed int v12; // esi@13
|
|
1636 signed int v13; // edi@14
|
|
1637 DWORD v14; // eax@26
|
|
1638 DWORD v15; // edi@26
|
|
1639 GUIWindow *v16; // ebx@36
|
|
1640 int v17; // esi@36
|
|
1641 int v18; // eax@36
|
|
1642 int v19; // ecx@36
|
|
1643 int v20; // esi@36
|
|
1644 int v21; // eax@36
|
|
1645 void *v22; // eax@39
|
|
1646 int v23; // esi@39
|
|
1647 GUIButton *v24; // ebx@39
|
|
1648 signed int v25; // eax@41
|
|
1649 //int v26; // esi@44
|
|
1650 //const char *v27; // eax@46
|
|
1651 char *v28; // eax@62
|
|
1652 int v29; // eax@62
|
|
1653 unsigned int v30; // ecx@62
|
|
1654 char *v31; // eax@63
|
|
1655 MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
|
|
1656 /*int v33; // [sp-38h] [bp-2C8h]@62
|
|
1657 int v34; // [sp-34h] [bp-2C4h]@62
|
|
1658 int v35; // [sp-30h] [bp-2C0h]@62
|
|
1659 int v36; // [sp-2Ch] [bp-2BCh]@62
|
|
1660 int v37; // [sp-28h] [bp-2B8h]@62
|
|
1661 int v38; // [sp-24h] [bp-2B4h]@62
|
|
1662 int v39; // [sp-20h] [bp-2B0h]@62
|
|
1663 int v40; // [sp-1Ch] [bp-2ACh]@62
|
|
1664 int v41; // [sp-18h] [bp-2A8h]@62
|
|
1665 int v42; // [sp-14h] [bp-2A4h]@62
|
|
1666 char *v43; // [sp-10h] [bp-2A0h]@62
|
|
1667 char *v44; // [sp-Ch] [bp-29Ch]@62
|
|
1668 unsigned int v45; // [sp-8h] [bp-298h]@62
|
|
1669 char *v46; // [sp-4h] [bp-294h]@62
|
|
1670 const char *v47[5]; // [sp+0h] [bp-290h]@7*/
|
|
1671 char v48[5][100]; // [sp+14h] [bp-27Ch]@37
|
|
1672 //char v49[100]; // [sp+78h] [bp-218h]@68
|
|
1673 //char v50[100]; // [sp+DCh] [bp-1B4h]@68
|
|
1674 //char v51[100]; // [sp+140h] [bp-150h]@68
|
|
1675 //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
|
|
1676 GUIWindow v53; // [sp+208h] [bp-88h]@1
|
|
1677 int v54; // [sp+25Ch] [bp-34h]@36
|
|
1678 int v55; // [sp+260h] [bp-30h]@36
|
|
1679 //unsigned int v56; // [sp+264h] [bp-2Ch]@1
|
|
1680 //int v57; // [sp+268h] [bp-28h]@1
|
|
1681 int v58; // [sp+26Ch] [bp-24h]@36
|
|
1682 //GUIWindow *v59; // [sp+270h] [bp-20h]@1
|
|
1683 unsigned int v60; // [sp+274h] [bp-1Ch]@36
|
|
1684 //Player *v61; // [sp+278h] [bp-18h]@1
|
|
1685 int v62; // [sp+27Ch] [bp-14h]@36
|
|
1686 int v63; // [sp+280h] [bp-10h]@14
|
|
1687 char *a1; // [sp+284h] [bp-Ch]@37
|
|
1688 unsigned int s1; // [sp+288h] [bp-8h]@1
|
|
1689 int v66; // [sp+28Ch] [bp-4h]@48
|
|
1690
|
|
1691 v0 = window_SpeakInHouse;
|
|
1692 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
|
|
1693 v2 = 255;
|
|
1694 //v61 = pPlayers[uActiveCharacter];
|
|
1695 v1 = pPlayers[uActiveCharacter];
|
|
1696 v53.uFrameX = 483;
|
|
1697 v53.uFrameWidth = 148;
|
|
1698 v53.uFrameZ = 334;
|
|
1699 auto color_default = TargetColor(255, 255, 255);
|
|
1700 auto color_selected = TargetColor(255, 255, 155);
|
|
1701 v3 = 52 * (unsigned int)v0->ptr_1C;
|
|
1702 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
|
|
1703 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
|
|
1704 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
|
|
1705
|
|
1706 v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
|
|
1707 v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
|
|
1708
|
|
1709 s1 = v4 * (100 - v1->GetMerchant()) / 100;
|
|
1710 if ( (signed int)s1 < v4 / 3 )
|
|
1711 s1 = v4 / 3;
|
|
1712 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
|
|
1713 {
|
1393
|
1714 if ( HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
1715 {
|
|
1716 v16 = pDialogueWindow;
|
|
1717 v58 = 255;
|
|
1718 v62 = 0;
|
|
1719 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
|
|
1720 //v59 = pDialogueWindow;
|
|
1721 v54 = v17;
|
|
1722 strcpy(v48[4], "");
|
|
1723 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
|
|
1724 v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0);
|
|
1725 v19 = v16->pNumPresenceButton;
|
|
1726 v20 = v18 + v17 + 146;
|
|
1727 v21 = v16->pStartingPosActiveItem;
|
|
1728 v63 = v20;
|
|
1729 v55 = v20;
|
|
1730 v60 = v21;
|
|
1731 if ( v21 >= v21 + v19 )
|
|
1732 goto LABEL_71;
|
|
1733 s1 = 2;
|
|
1734 a1 = (char *)v48;
|
|
1735 while ( 1 )
|
|
1736 {
|
|
1737 int v47 = v60;
|
|
1738 v22 = window_SpeakInHouse->ptr_1C;
|
|
1739 v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
|
|
1740 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
|
|
1741 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
|
|
1742 v24 = v16->GetControl(v60);
|
|
1743
|
|
1744 if (v23 != v58)
|
|
1745 {
|
|
1746 if (v23 >= 25)
|
|
1747 Log::Warning(L"Transport UI: scedule overflow");
|
|
1748 if (s1 >= 6)
|
|
1749 v25 = true;
|
|
1750 else
|
|
1751 v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
|
|
1752 }
|
|
1753
|
|
1754 if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
|
|
1755 {
|
|
1756 v58 = v23;
|
|
1757 if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
|
|
1758 sprintf(a1, "\f%05d", color_selected);
|
|
1759 else
|
|
1760 sprintf(a1, "\f%05d", color_default);
|
|
1761
|
|
1762 //v32.uRedbookTrackID = v27;
|
|
1763 v66 = transport_schedule[v23].uTravelTime;
|
|
1764 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
|
|
1765 {
|
|
1766 if ( CheckHiredNPCSpeciality(Sailor) )
|
|
1767 v66 -= 2;
|
|
1768 if ( CheckHiredNPCSpeciality(Navigator) )
|
|
1769 v66 -= 3;
|
|
1770 if ( CheckHiredNPCSpeciality(Pirate) )
|
|
1771 v66 -= 2;
|
|
1772 }
|
|
1773 else
|
|
1774 {
|
|
1775 if ( CheckHiredNPCSpeciality(Horseman) )
|
|
1776 v66 -= 2;
|
|
1777 }
|
|
1778 if ( CheckHiredNPCSpeciality(Explorer) )
|
|
1779 --v66;
|
|
1780 if ( v66 < 1 )
|
|
1781 v66 = 1;
|
|
1782 if ( v23 != v2 )
|
|
1783 {
|
|
1784 memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
|
|
1785 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
|
|
1786 v66, v32.pName);
|
|
1787 strcat(a1, pTmpBuf.data());
|
|
1788 v28 = a1;
|
|
1789 a1 += 100;
|
|
1790 ++v62;
|
|
1791 ++s1;
|
|
1792 strcat(v28, "\n \n");
|
|
1793 v24->uY = v63;
|
|
1794 v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0);
|
|
1795 v30 = v24->uY;
|
|
1796 v24->uHeight = v29;
|
|
1797 v2 = 255;
|
|
1798 v24->uW = v30 + v29 - 1;
|
|
1799 v63 += v54 + v29;
|
|
1800 }
|
|
1801 }
|
|
1802 else
|
|
1803 {
|
|
1804 v31 = a1;
|
|
1805 ++v62;
|
|
1806 ++s1;
|
|
1807 a1 += 100;
|
|
1808 strcpy(v31, "");
|
|
1809 if ( v24 )
|
|
1810 {
|
|
1811 v24->uW = 0;
|
|
1812 v24->uHeight = 0;
|
|
1813 v24->uY = 0;
|
|
1814 }
|
|
1815 }
|
|
1816 ++v60;
|
|
1817 if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
|
|
1818 break;
|
|
1819 //v16 = v59;
|
|
1820 }
|
|
1821 if ( v63 != v55 )
|
|
1822 {
|
|
1823 /*v47[1] = &Dest;
|
|
1824 v47[0] = &v51;
|
|
1825 v46 = &v50;
|
|
1826 v45 = (unsigned int)&v49;
|
|
1827 v44 = &v48;
|
|
1828 v43 = pTmpBuf2.data();*/
|
|
1829 sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]);
|
|
1830 v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
1831 }
|
|
1832 else
|
|
1833 {
|
|
1834 LABEL_71:
|
|
1835 v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
|
|
1836 color_default, pGlobalTXT_LocalizationStrings[561], 3);
|
|
1837 pAudioPlayer->StopChannels(-1, -1);
|
|
1838 }
|
|
1839 }
|
|
1840 }
|
|
1841 else
|
|
1842 {
|
|
1843 if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
|
|
1844 {
|
|
1845 if ( pParty->uNumGold < s1 )
|
|
1846 {
|
|
1847 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
1848 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
|
|
1849 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
1850 return;
|
|
1851 }
|
|
1852
|
|
1853 Party::TakeGold(s1);
|
|
1854
|
|
1855 v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
|
|
1856 if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
|
|
1857 {
|
|
1858 if ( _stricmp(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename) )
|
|
1859 {
|
|
1860 SaveGame(1, 0);
|
|
1861 strcpy(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename);
|
|
1862
|
|
1863 dword_6BE364_game_settings_1 |= 1u;
|
|
1864 _5B65B8_npcdata_hiword_house_or_other = 0;
|
|
1865 dword_5B65BC = 0;
|
|
1866 _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
|
|
1867 v11 = *((int *)v5 + 3);
|
|
1868 uGameState = GAME_STATE_2;
|
|
1869 _5B65A8_npcdata_uflags_or_other = v11;
|
|
1870 _5B65AC_npcdata_fame_or_other = v5->arrival_y;
|
|
1871 _5B65B0_npcdata_rep_or_other = v5->arrival_z;
|
|
1872 dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
|
|
1873 }
|
|
1874 else
|
|
1875 {
|
|
1876 pIndoorCamera->sRotationY = 0;
|
|
1877 pParty->uFlags |= 2u;
|
|
1878 pParty->vPosition.x = v5->arrival_x;
|
|
1879 pParty->vPosition.y = v5->arrival_y;
|
|
1880 pParty->vPosition.z = v5->arrival_z;
|
|
1881 pParty->uFallStartY = pParty->vPosition.z;
|
|
1882 pParty->sRotationX = 0;
|
|
1883 pParty->sRotationY = v5->arrival_rot_y;
|
|
1884 }
|
|
1885 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
1886 v12 = v5->uTravelTime;
|
|
1887 int _v47;
|
|
1888 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
|
|
1889 {
|
|
1890 v63 = SPEECH_SetSail;
|
|
1891 v13 = 2500;
|
|
1892 if ( CheckHiredNPCSpeciality(Sailor) )
|
|
1893 v12 -= 2;
|
|
1894 if ( CheckHiredNPCSpeciality(Navigator) )
|
|
1895 v12 -= 3;
|
|
1896 //_v47 = 45;
|
|
1897 if ( CheckHiredNPCSpeciality(Pirate) )
|
|
1898 v12 -= 2;
|
|
1899 }
|
|
1900 else
|
|
1901 {
|
|
1902 v63 = SPEECH_CarriageReady;
|
|
1903 v13 = 1500;
|
|
1904 //_v47 = 35;
|
|
1905 if ( CheckHiredNPCSpeciality(Horseman) )
|
|
1906 v12 -= 2;
|
|
1907 }
|
|
1908 if ( CheckHiredNPCSpeciality(Explorer) )
|
|
1909 --v12;
|
|
1910 if ( v12 < 1 )
|
|
1911 v12 = 1;
|
|
1912 RestAndHeal(1440 * v12);
|
|
1913 v1->PlaySound((PlayerSpeech)v63, 0);
|
|
1914 v14 = GetTickCount();
|
|
1915 v15 = v14 + v13;
|
|
1916 if ( v15 < v14 )
|
|
1917 v15 = v14;
|
|
1918 while ( GetTickCount() < v15 )
|
|
1919 sqrt(3.1415926);
|
|
1920 while ( sub_4BD8B5() )
|
|
1921 ;
|
|
1922 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
|
|
1923 return;
|
|
1924 }
|
|
1925 else
|
|
1926 {
|
|
1927 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
|
|
1928 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
|
|
1929 }
|
|
1930 }
|
|
1931 }
|
|
1932 }
|
|
1933 //----- (004B68EA) --------------------------------------------------------
|
|
1934 bool __fastcall IsTravelAvailable(int a1)
|
|
1935 {
|
|
1936 for (uint i = 0; i < 4; ++i)
|
|
1937 {
|
|
1938 uint route = transport_routes[a1][i];
|
|
1939 if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
|
|
1940 {
|
|
1941 if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
|
|
1942 return true;
|
|
1943 }
|
|
1944 }
|
|
1945 return false;
|
|
1946 }
|
|
1947
|
|
1948
|
|
1949
|
|
1950 //----- (004B7911) --------------------------------------------------------
|
|
1951 void __cdecl TownHallDialog()
|
|
1952 {
|
|
1953 GUIWindow *v0; // eax@4
|
|
1954 int v1; // eax@10
|
|
1955 int v2; // esi@10
|
|
1956 GUIFont *v3; // ST20_4@20
|
|
1957 int v4; // eax@20
|
|
1958 MonsterInfo *v5; // edi@21
|
|
1959 unsigned int v6; // ST20_4@21
|
|
1960 char *v7; // ST1C_4@21
|
|
1961 unsigned int v8; // eax@21
|
|
1962 int v9; // esi@21
|
|
1963 char *v10; // eax@23
|
|
1964 signed int v11; // ebx@24
|
|
1965 signed int i; // esi@26
|
|
1966 int v13; // eax@27
|
|
1967 GUIWindow *v14; // ecx@28
|
|
1968 __int64 v15; // qax@28
|
|
1969 signed int v16; // ebx@28
|
|
1970 int v17; // ebx@28
|
|
1971 unsigned __int8 v18; // sf@28
|
|
1972 char **v19; // edi@29
|
|
1973 GUIButton *v20; // eax@30
|
|
1974 GUIButton *v21; // esi@30
|
|
1975 int v22; // eax@30
|
|
1976 unsigned int v23; // ecx@30
|
|
1977 unsigned __int16 v24; // ax@30
|
|
1978 GUIWindow a1; // [sp+Ch] [bp-110h]@21
|
|
1979 GUIWindow w; // [sp+60h] [bp-BCh]@21
|
|
1980 GUIWindow _this; // [sp+B4h] [bp-68h]@1
|
|
1981 int v28; // [sp+108h] [bp-14h]@1
|
|
1982 int v29; // [sp+10Ch] [bp-10h]@28
|
|
1983 int v30; // [sp+110h] [bp-Ch]@1
|
|
1984 int v31; // [sp+114h] [bp-8h]@29
|
|
1985 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
|
|
1986
|
|
1987 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
|
|
1988 _this.uFrameX = 483;
|
|
1989 _this.uFrameWidth = 148;
|
|
1990 _this.uFrameZ = 334;
|
|
1991 v28 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
1992 v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
1993 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
|
|
1994 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf.data(), 3u);
|
|
1995 switch(dialog_menu_id)
|
|
1996 {
|
|
1997 case HOUSE_DIALOGUE_MAIN:
|
|
1998 {
|
|
1999 v11 = 1;
|
|
2000 pOutString = 0;
|
|
2001 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
|
|
2002 if ( pParty->uFine )
|
|
2003 {
|
|
2004 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
|
|
2005 v11 = 2;
|
|
2006 }
|
|
2007 for ( i = 0; i < v11; ++i )
|
|
2008 {
|
|
2009 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
|
|
2010 pOutString = (GUIFont *)((char *)pOutString + v13);
|
|
2011 }
|
|
2012 v29 = (100 - (signed int)pOutString) / v11;
|
|
2013 v14 = pDialogueWindow;
|
|
2014 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
|
|
2015 v16 = v15 - HIDWORD(v15);
|
|
2016 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
|
|
2017 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
|
|
2018 v17 = (v16 >> 1) - v29 / 2 + 158;
|
|
2019 v18 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
2020 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
|
|
2021 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
|
|
2022 {
|
|
2023 v31 = 2;
|
|
2024 v19 = pShopOptions.data();
|
|
2025 do
|
|
2026 {
|
|
2027 v20 = v14->GetControl((unsigned int)pOutString);
|
|
2028 v21 = v20;
|
|
2029 v20->uY = v29 + v17;
|
|
2030 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
|
|
2031 v23 = v21->uY;
|
|
2032 v21->uHeight = v22;
|
|
2033 v17 = v23 + v22 - 1;
|
|
2034 v21->uW = v17;
|
|
2035 v24 = v30;
|
|
2036 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
|
|
2037 v24 = v28;
|
|
2038 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
|
|
2039 v14 = pDialogueWindow;
|
|
2040 ++v31;
|
|
2041 ++v19;
|
|
2042 pOutString = (GUIFont *)((char *)pOutString + 1);
|
|
2043 }
|
|
2044 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
2045 }
|
|
2046 break;
|
|
2047 }
|
|
2048
|
|
2049 case HOUSE_DIALOGUE_TOWNHALL_99:
|
|
2050 {
|
|
2051 v5 = &pMonsterStats->pInfos[word_F8B1A0];
|
|
2052 v6 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2053 v7 = v5->pName;
|
|
2054 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2055 sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
|
|
2056 sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * v5->uLevel);
|
|
2057 current_npc_text = pTmpBuf2.data();
|
|
2058 memcpy(&a1, pDialogueWindow, sizeof(a1));
|
|
2059 w.uFrameWidth = 458;
|
|
2060 w.uFrameZ = 457;
|
|
2061 pOutString = pFontArrus;
|
|
2062 v9 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &w, 13, 0) + 7;
|
|
2063 if ( 352 - v9 < 8 )
|
|
2064 {
|
|
2065 pOutString = pFontCreate;
|
|
2066 v9 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
2067 }
|
|
2068
|
|
2069 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2070 pRenderer->_4A6A68(8u, 352 - v9, pTex, pTex->uTextureHeight - v9);
|
|
2071 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
|
|
2072 v10 = FitTextInAWindow(current_npc_text, pOutString, &w, 0xDu, 0);
|
|
2073 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
|
|
2074 break;
|
|
2075 }
|
|
2076 case HOUSE_DIALOGUE_TOWNHALL_100:
|
|
2077 {
|
|
2078 v0 = window_SpeakInHouse;
|
|
2079 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
|
|
2080 {
|
|
2081 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay" "How Much?"
|
|
2082 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf.data(), 3u);
|
|
2083 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
|
|
2084 v3 = pFontArrus;
|
|
2085 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2086 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
|
|
2087 return;
|
|
2088 }
|
|
2089 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2090 {
|
|
2091 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2092 v2 = v1;
|
|
2093 if ( v1 <= 0 )
|
|
2094 {
|
|
2095 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2096 return;
|
|
2097 }
|
|
2098 if ( v1 > pParty->uNumGold )
|
|
2099 {
|
|
2100 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2101 v2 = pParty->uNumGold;
|
|
2102 }
|
|
2103 if ( v2 > pParty->uFine )
|
|
2104 v2 = pParty->uFine;
|
|
2105 Party::TakeGold(v2);
|
|
2106 pParty->uFine -= v2;
|
|
2107 if ( pParty->uFine < 0 )
|
|
2108 pParty->uFine = 0;
|
|
2109 if ( uActiveCharacter )
|
|
2110 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
|
|
2111 v0 = window_SpeakInHouse;
|
|
2112 }
|
|
2113 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
|
|
2114 {
|
|
2115 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2116 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2117 }
|
|
2118 break;
|
|
2119 }
|
|
2120 default:
|
|
2121 {
|
|
2122 break;
|
|
2123 }
|
|
2124 }
|
|
2125 return;
|
|
2126 }
|
|
2127
|
|
2128 //----- (004B7D7E) --------------------------------------------------------
|
|
2129 void __cdecl BankDialog()
|
|
2130 {
|
|
2131 GUIWindow *v0; // eax@4
|
|
2132 //int v1; // ecx@5
|
|
2133 int v2; // eax@6
|
|
2134 unsigned int v3; // esi@6
|
|
2135 GUIFont *v4; // ST10_4@12
|
|
2136 int v5; // eax@12
|
|
2137 int v6; // eax@19
|
|
2138 unsigned int v7; // esi@19
|
|
2139 unsigned __int16 v8; // ax@27
|
|
2140 unsigned __int16 v9; // ax@29
|
|
2141 char *v10; // [sp-8h] [bp-70h]@11
|
|
2142 char *v11; // [sp-4h] [bp-6Ch]@11
|
|
2143 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
|
|
2144 __int16 v13[2]; // [sp+60h] [bp-8h]@1
|
|
2145 __int16 v14[2]; // [sp+64h] [bp-4h]@1
|
|
2146
|
|
2147 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
|
|
2148 _this.uFrameX = 483;
|
|
2149 _this.uFrameWidth = 148;
|
|
2150 _this.uFrameZ = 334;
|
|
2151 *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2152 *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2153 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
|
|
2154 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf.data(), 3u);
|
|
2155 switch(dialog_menu_id)
|
|
2156 {
|
|
2157 case HOUSE_DIALOGUE_MAIN:
|
|
2158 {
|
|
2159 v8 = v14[0];
|
|
2160 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
|
|
2161 v8 = v13[0];
|
|
2162 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
|
|
2163 v9 = v14[0];
|
|
2164 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
|
|
2165 v9 = v13[0];
|
|
2166 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
|
|
2167 break;
|
|
2168 }
|
|
2169 case HOUSE_DIALOGUE_BANK_7:
|
|
2170 {
|
|
2171 v0 = window_SpeakInHouse;
|
|
2172 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
|
|
2173 {
|
|
2174 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2175 {
|
|
2176 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2177 v7 = v6;
|
|
2178 if ( !v6 )
|
|
2179 {
|
|
2180 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2181 return;
|
|
2182 }
|
|
2183 if ( v6 > pParty->uNumGold )
|
|
2184 {
|
|
2185 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2186 v7 = pParty->uNumGold;
|
|
2187 }
|
|
2188 if ( v7 )
|
|
2189 {
|
|
2190 Party::TakeGold(v7);
|
|
2191 pParty->uNumGoldInBank += v7;
|
|
2192 if ( uActiveCharacter )
|
|
2193 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
|
|
2194 }
|
|
2195 v0 = window_SpeakInHouse;
|
|
2196 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2197 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2198 return;
|
|
2199 }
|
|
2200 if (window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
|
|
2201 return;
|
|
2202 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2203 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2204 return;
|
|
2205 }
|
|
2206 v11 = pGlobalTXT_LocalizationStrings[112];
|
|
2207 v10 = pGlobalTXT_LocalizationStrings[60];
|
|
2208 sprintf(pTmpBuf.data(), "%s\n%s", v10, v11);
|
|
2209 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
|
|
2210 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
|
|
2211 v4 = pFontArrus;
|
|
2212 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2213 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
|
|
2214 break;
|
|
2215 }
|
|
2216
|
|
2217 case HOUSE_DIALOGUE_BANK_8:
|
|
2218 {
|
|
2219 v0 = window_SpeakInHouse;
|
|
2220 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
|
|
2221 {
|
|
2222 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2223 {
|
|
2224 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2225 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2226 v3 = v2;
|
|
2227 if ( v2 )
|
|
2228 {
|
|
2229 if ( v2 > pParty->uNumGoldInBank )
|
|
2230 {
|
|
2231 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2232 v3 = pParty->uNumGoldInBank;
|
|
2233 }
|
|
2234 if ( v3 )
|
|
2235 {
|
|
2236 Party::SetGold(pParty->uNumGold + v3);
|
|
2237 pParty->uNumGoldInBank -= v3;
|
|
2238 }
|
|
2239 }
|
|
2240 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2241 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2242 return;
|
|
2243 }
|
|
2244 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
|
|
2245 return;
|
|
2246 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2247 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2248 return;
|
|
2249 }
|
|
2250 v11 = pGlobalTXT_LocalizationStrings[112];
|
|
2251 v10 = pGlobalTXT_LocalizationStrings[244];
|
|
2252 sprintfex(pTmpBuf.data(), "%s\n%s", v10, v11);
|
|
2253 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
|
|
2254 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
|
|
2255 v4 = pFontArrus;
|
|
2256 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2257 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
|
|
2258 return;
|
|
2259 break;
|
|
2260 }
|
|
2261
|
|
2262 default:
|
|
2263 {
|
|
2264 break;
|
|
2265 }
|
|
2266 }
|
|
2267 }
|
|
2268 // F8B19C: using guessed type int dword_F8B19C;
|
|
2269
|
|
2270 //----- (004B8285) --------------------------------------------------------
|
|
2271 void __cdecl TavernDialog()
|
|
2272 {
|
|
2273 int v0;
|
|
2274 int pItemNum;
|
|
2275 double v2; // st7@1
|
|
2276 signed int v3; // ebx@1
|
|
2277 int v4; // ecx@1
|
|
2278 int v5; // esi@3
|
|
2279 signed int v6; // edi@5
|
|
2280 int v7; // ecx@5
|
|
2281 int pNumString; // edi@16
|
|
2282 signed int v9; // esi@16
|
|
2283 unsigned int pNumActiveItem; // esi@18
|
|
2284 int v11; // eax@18
|
|
2285 unsigned int v12; // eax@19
|
|
2286 int v13; // eax@21
|
|
2287 int v14; // ecx@26
|
|
2288 //GUIButton *v15; // eax@28
|
|
2289 //GUIButton *v16; // esi@28
|
|
2290 int v17; // eax@28
|
|
2291 char *v18; // eax@30
|
|
2292 int v19; // eax@30
|
|
2293 unsigned int v20; // ecx@30
|
|
2294 int v21; // edx@30
|
|
2295 int v22; // eax@30
|
|
2296 unsigned __int16 v23; // ax@30
|
|
2297 int v24; // eax@34
|
|
2298 int v25; // eax@34
|
|
2299 char *v26; // esi@36
|
|
2300 int v27; // edi@46
|
|
2301 unsigned int pColorText; // eax@57
|
|
2302 signed int v31; // eax@59
|
|
2303 //GUIWindow *v33; // edi@64
|
|
2304 int v34; // eax@64
|
|
2305 int v35; // ecx@64
|
|
2306 int v36; // esi@64
|
|
2307 char v37; // sf@64
|
|
2308 GUIButton *pButton; // eax@65
|
|
2309 int v39; // edx@69
|
|
2310 int v40; // ecx@69
|
|
2311 int v41; // ecx@69
|
|
2312 int v42; // ecx@70
|
|
2313 unsigned int v43; // edx@70
|
|
2314 int v44; // edx@71
|
|
2315 int v45; // ecx@71
|
|
2316 int v46; // ecx@72
|
|
2317 int v47; // eax@74
|
|
2318 signed int v48; // edi@77
|
|
2319 signed int i; // esi@79
|
|
2320 int v50; // eax@80
|
|
2321 //GUIWindow *v51; // ecx@81
|
|
2322 _QWORD v52; // qax@81
|
|
2323 signed int v53; // edi@81
|
|
2324 int v54; // edi@81
|
|
2325 //GUIButton *v55; // esi@83
|
|
2326 const char **v56; // eax@83
|
|
2327 int v57; // eax@83
|
|
2328 unsigned int v58; // ecx@83
|
|
2329 //Player *v59; // edx@83
|
|
2330 unsigned __int16 v60; // ax@83
|
|
2331 int v61; // eax@99
|
|
2332 char *v63; // eax@99
|
|
2333 GUIFont *v64; // edx@99
|
|
2334 GUIFont *v65; // edi@100
|
|
2335 unsigned int v66; // [sp-10h] [bp-284h]@75
|
|
2336 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
|
|
2337 int v68; // [sp-Ch] [bp-280h]@99
|
|
2338 char *v69; // [sp-8h] [bp-27Ch]@75
|
|
2339 int v70; // [sp-8h] [bp-27Ch]@99
|
|
2340 unsigned int v71; // [sp-4h] [bp-278h]@75
|
|
2341 const char *v72; // [sp-4h] [bp-278h]@93
|
|
2342 unsigned int v73; // [sp-4h] [bp-278h]@99
|
|
2343 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
|
|
2344 char pTopic4[100]; // [sp+70h] [bp-204h]@59
|
|
2345 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
|
|
2346 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
|
|
2347 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
|
|
2348 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
|
|
2349 char *Str[2]; // [sp+244h] [bp-30h]@30
|
|
2350 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
|
|
2351 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
|
|
2352 int v83; // [sp+254h] [bp-20h]@1
|
|
2353 int pColorYellow; // [sp+258h] [bp-1Ch]@1
|
|
2354 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
|
|
2355 int all_text_height; // [sp+260h] [bp-14h]@18
|
|
2356 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
|
|
2357 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
|
|
2358 int v89; // [sp+268h] [bp-Ch]@1
|
|
2359 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
|
|
2360 int v91; // [sp+270h] [bp-4h]@3
|
|
2361 GUIFont *pOutString;
|
|
2362 unsigned __int8 pTopic4Height;
|
|
2363 int pTextHeight;
|
|
2364
|
|
2365 pPlayer = pPlayers[uActiveCharacter];
|
|
2366 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
|
|
2367 dialog_window.uFrameX = 483;
|
|
2368 dialog_window.uFrameWidth = 148;
|
|
2369 dialog_window.uFrameZ = 334;
|
|
2370 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2371 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2372 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2373 *(float *)&v83 = v2;
|
|
2374 *(float *)&v89 = v2 * v2;
|
|
2375 v3 = (signed __int64)(*(float *)&v89 * 0.1);
|
|
2376 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2377 if ( pItemNum < v3 / 3 )
|
|
2378 pItemNum = v3 / 3;
|
|
2379 v5 = 1;
|
|
2380 pOutString = (GUIFont *)pItemNum;
|
|
2381 if ( pItemNum <= 0 )
|
|
2382 pOutString = (GUIFont *)1;
|
|
2383 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
|
|
2384 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2385 if ( v7 < v6 / 3 )
|
|
2386 v7 = v6 / 3;
|
|
2387 v83 = v7;
|
|
2388 if ( v7 <= 0 )
|
|
2389 {
|
|
2390 v7 = 1;
|
|
2391 v83 = 1;
|
|
2392 }
|
|
2393
|
|
2394 switch(dialog_menu_id)
|
|
2395 {
|
|
2396 case HOUSE_DIALOGUE_MAIN:
|
|
2397 {
|
1393
|
2398 if ( !HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
2399 return;
|
|
2400
|
|
2401 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
|
|
2402 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
|
|
2403 strcat(pTopic1, pTmpBuf2.data());
|
|
2404 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
|
|
2405 strcat(pTopic1, "\n \n");
|
|
2406
|
|
2407 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
|
|
2408 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
|
|
2409 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
|
|
2410 strcat(pTopic2, pTmpBuf2.data());
|
|
2411 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
|
|
2412 strcat(pTopic2, "\n \n");
|
|
2413
|
|
2414 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite);
|
|
2415 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
|
|
2416 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
|
|
2417 strcat(pTopic3, "\n \n");
|
|
2418 pTopic4[0] = 0;
|
|
2419 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
|
|
2420 {
|
|
2421 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
|
|
2422 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
|
|
2423 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
|
|
2424 }
|
|
2425 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2426 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
|
|
2427 v37 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
2428 if ( !(v37 ^ (pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton)) )
|
|
2429 {
|
|
2430 do
|
|
2431 {
|
|
2432 pButton = pDialogueWindow->GetControl(pNumActiveItem);
|
|
2433 if ( pButton->msg_param == 15 )
|
|
2434 {
|
|
2435 v46 = pTopic1Height;
|
|
2436 pButton->uHeight = pTopic1Height;
|
|
2437 pButton->uY = 146;
|
|
2438 v41 = v46 + 145;
|
|
2439 pButton->uW = v41;
|
|
2440 }
|
|
2441 else if ( pButton->msg_param == 16 )
|
|
2442 {
|
|
2443 v44 = pTopic2Height;
|
|
2444 v45 = pTopic1Height + v36 + 146;
|
|
2445 pButton->uHeight = pTopic2Height;
|
|
2446 pButton->uY = v45;
|
|
2447 v41 = v45 + v44 - 1;
|
|
2448 pButton->uW = v41;
|
|
2449 }
|
|
2450 else if ( pButton->msg_param == 96 )
|
|
2451 {
|
|
2452 v42 = pTopic1Height + pTopic2Height + 2 * v36 + 146;
|
|
2453 v43 = pTopic3Height;
|
|
2454 pButton->uY = v42;
|
|
2455 pButton->uHeight = v43;
|
|
2456 v41 = v43 + v42 - 1;
|
|
2457 pButton->uW = v41;
|
|
2458 }
|
|
2459 else if ( pButton->msg_param == 101 )
|
|
2460 {
|
|
2461 v39 = pTopic1Height + 3 * v36 + pTopic4Height + pTopic2Height + 146;
|
|
2462 v40 = pTopic4Height;
|
|
2463 pButton->uHeight = pTopic4Height;
|
|
2464 pButton->uY = v39;
|
|
2465 v41 = v39 + v40 - 1;
|
|
2466 pButton->uW = v41;
|
|
2467 }
|
|
2468 pNumActiveItem++;
|
|
2469 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
|
|
2470 {
|
1396
|
2471 sprintfex(pTmpBuf.data(), "%s%s%s%s", pTopic1, pTopic2, pTopic3, pTopic4);
|
1298
|
2472 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
|
|
2473 }
|
|
2474 }
|
|
2475 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
|
|
2476 }
|
|
2477 break;
|
|
2478 }
|
|
2479 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
|
|
2480 {
|
|
2481 pOutString = pFontArrus;
|
|
2482 strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
|
|
2483 dialog_window.uFrameWidth = game_viewport_width;
|
|
2484 dialog_window.uFrameZ = 452;
|
|
2485 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
|
|
2486 if ( 352 - pTextHeight < 8 )
|
|
2487 {
|
|
2488 pOutString = pFontCreate;
|
|
2489 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
|
|
2490 }
|
|
2491 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2492 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, pTex->uTextureHeight - pTextHeight);
|
|
2493 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
|
|
2494 v63 = FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0);
|
|
2495 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
|
|
2496 break;
|
|
2497 }
|
|
2498 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
|
|
2499 {
|
|
2500 strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
|
|
2501 dialog_window.uFrameWidth = game_viewport_width;
|
|
2502 dialog_window.uFrameZ = 452;
|
|
2503 v61 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0);
|
|
2504 pTextHeight = v61 + 7;
|
|
2505 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2506 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, pTex->uTextureHeight - (v61 + 7));
|
|
2507 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
|
|
2508 v63 = FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0);
|
|
2509 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
|
|
2510 break;
|
|
2511 }
|
|
2512 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
|
|
2513 {
|
|
2514 if ( pArcomageGame->bGameInProgress == 1 )
|
|
2515 return;
|
|
2516 if ( pArcomageGame->uGameResult )
|
|
2517 {
|
|
2518 if ( pArcomageGame->uGameResult == 1 )
|
|
2519 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
|
|
2520 else
|
|
2521 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
|
|
2522 }
|
|
2523 else
|
|
2524 {
|
|
2525 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
|
|
2526 }
|
|
2527 strcpy(pTmpBuf.data(), v72);
|
|
2528 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
|
|
2529 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3);
|
|
2530 break;
|
|
2531 }
|
|
2532 case HOUSE_DIALOGUE_TAVERN_REST:
|
|
2533 {
|
|
2534 if ( pParty->uNumGold >= (unsigned int)pOutString )
|
|
2535 {
|
|
2536 Party::TakeGold((unsigned int)pOutString);
|
|
2537 v27 = (int)window_SpeakInHouse->ptr_1C;//107
|
|
2538 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2539 dialog_menu_id = HOUSE_DIALOGUE_NULL;
|
|
2540 sub_4BD8B5();
|
|
2541 sub_4B1D27();
|
|
2542 pVideoPlayer->Unload();
|
|
2543 window_SpeakInHouse->Release();
|
|
2544 window_SpeakInHouse = 0;
|
|
2545 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
2546 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
|
2547 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_RentRoom;
|
|
2548 pMessageQueue_50CBD0->pMessages[0].param = v27;
|
|
2549 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
|
|
2550 ++pMessageQueue_50CBD0->uNumMessages;
|
|
2551 return;
|
|
2552 }
|
|
2553 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
|
|
2554 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
|
|
2555 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2556 break;
|
|
2557 }
|
|
2558
|
|
2559 case HOUSE_DIALOGUE_LEARN_SKILLS:
|
|
2560 {
|
1393
|
2561 if ( !HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
2562 return;
|
|
2563 v0 = 0;
|
|
2564 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
|
|
2565 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2566 if ( pItemNum < v9 / 3 )
|
|
2567 pItemNum = v9 / 3;
|
|
2568 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2569 all_text_height = 0;
|
|
2570 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2571 {
|
|
2572 do
|
|
2573 {
|
|
2574 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
|
|
2575 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
|
|
2576 {
|
|
2577 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
|
|
2578 v0++;
|
|
2579 }
|
|
2580 ++pNumActiveItem;
|
|
2581 }
|
|
2582 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
|
|
2583 if ( v0 )
|
|
2584 {
|
|
2585 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
|
|
2586 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
|
|
2587 v91 = (149 - all_text_height) / v0;
|
|
2588 if ( (149 - all_text_height) / v0 > 32 )
|
|
2589 v91 = 32;
|
|
2590 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
|
|
2591 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2592 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2593 {
|
|
2594 pItemNum = 2;
|
|
2595 do
|
|
2596 {
|
|
2597 pButton = pDialogueWindow->GetControl(pItemNum);
|
|
2598 v17 = pButton->msg_param - 36;
|
|
2599 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
|
|
2600 {
|
|
2601 pButton->uW = 0;
|
|
2602 pButton->uHeight = 0;
|
|
2603 pButton->uY = 0;
|
|
2604 }
|
|
2605 else
|
|
2606 {
|
|
2607 pButton->uY = v91 + v14;
|
|
2608 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
|
|
2609 pButton->uHeight = pTextHeight;
|
|
2610 v14 = pTextHeight + pButton->uY - 1;
|
|
2611 pButton->uW = v14;
|
|
2612 pColorText = pColorYellow;
|
|
2613 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
|
|
2614 pColorText = pColorWhite;
|
|
2615 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
|
|
2616 }
|
|
2617 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
|
|
2618 pItemNum++;
|
|
2619 }
|
|
2620 while ( pItemNum < pNumActiveItem );
|
|
2621 }
|
|
2622 return;
|
|
2623 }
|
|
2624 }
|
|
2625 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
|
|
2626 strcat(pTmpBuf.data(), "\n \n");
|
|
2627 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
2628 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
|
|
2629 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3);
|
|
2630 return;
|
|
2631 }
|
|
2632
|
|
2633 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
|
|
2634 {
|
|
2635 *(_QWORD *)Str = pParty->uNumFoodRations;
|
|
2636 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
|
|
2637 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
|
|
2638 {
|
|
2639 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
|
|
2640 if ( uActiveCharacter )
|
|
2641 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
|
|
2642 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2643 return;
|
|
2644 }
|
|
2645 if ( pParty->uNumGold >= v7 )
|
|
2646 {
|
|
2647 Party::TakeGold(v7);
|
|
2648 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
2649 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2650 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
|
|
2651 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2652 return;
|
|
2653 }
|
|
2654 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
|
|
2655 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
|
|
2656 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2657 break;
|
|
2658 }
|
|
2659
|
|
2660 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
|
|
2661 {
|
1393
|
2662 if ( HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
2663 {
|
|
2664 v48 = 2;
|
|
2665 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
|
|
2666 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
|
|
2667 pOutString = 0;
|
|
2668 if ( pParty->HasItem(0x28Bu) )
|
|
2669 {
|
|
2670 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
|
|
2671 v48 = 3;
|
|
2672 }
|
|
2673 for ( i = 0; i < v48; ++i )
|
|
2674 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
|
|
2675 all_text_height = (174 - all_text_height) / v48;
|
|
2676 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2677 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138;
|
|
2678 v37 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
2679 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2680 {
|
|
2681 pItemNum = 2;
|
|
2682 pNumString = 0;
|
|
2683 do
|
|
2684 {
|
|
2685 pButton = pDialogueWindow->GetControl(pItemNum);
|
|
2686 pButton->uY = all_text_height + v54;
|
|
2687 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
|
|
2688 pButton->uHeight = pTextHeight;
|
|
2689 v54 = pButton->uY + pTextHeight - 1;
|
|
2690 pButton->uW = v54;
|
|
2691 pColorText = pColorYellow;
|
|
2692 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
|
|
2693 pColorText = pColorWhite;
|
|
2694 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
|
|
2695 pItemNum++;
|
|
2696 ++pNumString;
|
|
2697 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
|
|
2698 }
|
|
2699 while ( pItemNum < pNumActiveItem );
|
|
2700 }
|
|
2701 }
|
|
2702 break;
|
|
2703 }
|
|
2704 default:
|
|
2705 {
|
|
2706 break;
|
|
2707 }
|
|
2708 }
|
|
2709 }
|
|
2710
|
|
2711 //----- (004B705E) --------------------------------------------------------
|
|
2712 void TempleDialog()
|
|
2713 {
|
|
2714 GUIWindow *v0; // ebx@1
|
|
2715 Player *v1; // esi@1
|
|
2716 int v2; // edi@1
|
|
2717 int result; // eax@4
|
|
2718 GUIWindow *v4; // edi@6
|
|
2719 void *v5; // eax@6
|
|
2720 int v6; // eax@6
|
|
2721 unsigned int v7; // eax@8
|
|
2722 int v8; // ecx@8
|
|
2723 unsigned int v9; // eax@9
|
|
2724 int v10; // eax@11
|
|
2725 int v11; // eax@12
|
|
2726 GUIWindow *v12; // ecx@16
|
|
2727 int v13; // edx@16
|
|
2728 GUIButton *v14; // eax@19
|
|
2729 GUIButton *v15; // edi@19
|
|
2730 int v16; // eax@19
|
|
2731 const char *v17; // eax@21
|
|
2732 int v18; // eax@21
|
|
2733 unsigned int v19; // ecx@21
|
|
2734 int v20; // eax@21
|
|
2735 unsigned __int16 v21; // ax@21
|
|
2736 unsigned __int16 v22; // ST14_2@27
|
|
2737 int v23; // eax@27
|
|
2738 double v24; // st7@28
|
|
2739 unsigned int v25; // ebx@28
|
|
2740 DDM_DLV_Header *v26; // edi@29
|
|
2741 int v27; // eax@31
|
|
2742 int v28; // eax@32
|
|
2743 //unsigned int v29; // ecx@34
|
|
2744 unsigned int v30; // edx@36
|
|
2745 unsigned int v31; // edx@38
|
|
2746 unsigned int v32; // edx@40
|
|
2747 unsigned int v33; // edx@42
|
|
2748 unsigned int v34; // edx@44
|
|
2749 int v35; // edi@50
|
|
2750 signed int v36; // eax@50
|
|
2751 unsigned __int8 v37; // al@54
|
|
2752 int v38; // ecx@54
|
|
2753 GUIWindow *v39; // eax@56
|
|
2754 unsigned __int8 v40; // al@61
|
|
2755 GUIButton *v41; // edi@64
|
|
2756 int v42; // esi@66
|
|
2757 GUIWindow *v43; // ecx@66
|
|
2758 int v44; // edi@66
|
|
2759 int v45; // eax@68
|
|
2760 signed int v46; // edi@69
|
|
2761 int v47; // edi@71
|
|
2762 GUIButton *v48; // eax@73
|
|
2763 const char *v49; // edx@73
|
|
2764 GUIButton *v50; // esi@73
|
|
2765 int v51; // eax@73
|
|
2766 unsigned int v52; // ecx@73
|
|
2767 unsigned __int16 v53; // ax@73
|
|
2768 char a1[300]; // [sp+10h] [bp-1B4h]@64
|
|
2769 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
|
|
2770 __int64 v58; // [sp+190h] [bp-34h]@1
|
|
2771 __int64 v59; // [sp+198h] [bp-2Ch]@1
|
|
2772 __int64 v60; // [sp+1A0h] [bp-24h]@1
|
|
2773 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
|
|
2774 unsigned int v62; // [sp+1B0h] [bp-14h]@8
|
|
2775 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
|
|
2776 int v64; // [sp+1B8h] [bp-Ch]@6
|
|
2777 unsigned int v65; // [sp+1BCh] [bp-8h]@6
|
|
2778 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
|
|
2779
|
|
2780 v0 = window_SpeakInHouse;
|
|
2781 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
|
|
2782 v57.uFrameX = 483;
|
|
2783 v57.uFrameWidth = 148;
|
|
2784 v57.uFrameZ = 334;
|
|
2785 HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2786 HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2787 v1 = pPlayers[uActiveCharacter];
|
|
2788 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
|
|
2789 v2 = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[v0->par1C - 1].fPriceMultiplier);
|
|
2790 HIDWORD(v60) = v2;
|
|
2791 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
|
|
2792 {
|
|
2793 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
|
|
2794 {
|
|
2795 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
|
|
2796 {
|
|
2797 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
|
|
2798 {
|
1393
|
2799 if ( HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
2800 {
|
|
2801 v4 = pDialogueWindow;
|
|
2802 v61 = pDialogueWindow;
|
|
2803 v5 = window_SpeakInHouse->ptr_1C;
|
|
2804 v66 = 0;
|
|
2805 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
|
|
2806 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
|
|
2807 v6 = v1->GetMerchant();
|
|
2808 v64 = (signed int)(v65 * (100 - v6)) / 100;
|
|
2809 if ( v64 < (signed int)v65 / 3 )
|
|
2810 v64 = (signed int)v65 / 3;
|
|
2811 v7 = v4->pStartingPosActiveItem;
|
|
2812 v8 = v7 + v4->pNumPresenceButton;
|
|
2813 v65 = 0;
|
|
2814 v62 = v7;
|
|
2815 if ( (signed int)v7 >= v8 )
|
|
2816 goto LABEL_78;
|
|
2817 do
|
|
2818 {
|
|
2819 v9 = v4->GetControl(v62)->msg_param - 36;
|
|
2820 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
|
|
2821 {
|
|
2822 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
|
|
2823 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
|
|
2824 ++v65;
|
|
2825 }
|
|
2826 v11 = v4->pStartingPosActiveItem;
|
|
2827 ++v62;
|
|
2828 }
|
|
2829 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
|
|
2830 if ( v65 )
|
|
2831 {
|
|
2832 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
|
|
2833 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
2834 v64 = (149 - (signed int)v66) / (signed int)v65;
|
|
2835 if ( v64 > 32 )
|
|
2836 v64 = 32;
|
|
2837 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
|
|
2838 v12 = v61;
|
|
2839 result = v61->pStartingPosActiveItem;
|
|
2840 v13 = result + v61->pNumPresenceButton;
|
|
2841 v62 = v61->pStartingPosActiveItem;
|
|
2842 if ( result < v13 )
|
|
2843 {
|
|
2844 v66 = (DDM_DLV_Header *)2;
|
|
2845 while ( 1 )
|
|
2846 {
|
|
2847 v14 = v12->GetControl(v62);
|
|
2848 v15 = v14;
|
|
2849 v16 = v14->msg_param - 36;
|
|
2850 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
|
|
2851 {
|
|
2852 v15->uW = 0;
|
|
2853 v15->uHeight = 0;
|
|
2854 v15->uY = 0;
|
|
2855 }
|
|
2856 else
|
|
2857 {
|
|
2858 v17 = pSkillNames[v16];
|
|
2859 v15->uY = v64 + v65;
|
|
2860 HIDWORD(v60) = (uint32)v17;
|
|
2861 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
|
|
2862 v19 = v15->uY;
|
|
2863 v15->uHeight = v18;
|
|
2864 v20 = v19 + v18 - 1;
|
|
2865 v15->uW = v20;
|
|
2866 v65 = v20;
|
|
2867 v21 = WORD2(v59);
|
|
2868 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
|
|
2869 v21 = WORD2(v58);
|
|
2870 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
|
|
2871 }
|
|
2872 result = (int)v61;
|
|
2873 ++v62;
|
|
2874 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
|
|
2875 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
|
|
2876 break;
|
|
2877 v12 = v61;
|
|
2878 }
|
|
2879 }
|
|
2880 }
|
|
2881 else
|
|
2882 {
|
|
2883 LABEL_78:
|
|
2884 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
|
|
2885 strcat(pTmpBuf.data(), "\n \n");
|
|
2886 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
2887 v22 = WORD2(v59);
|
|
2888 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v57, 0, 0);
|
|
2889 v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
|
|
2890 }
|
|
2891 }
|
|
2892 }
|
|
2893 return;
|
|
2894 }
|
|
2895 // DONATION
|
|
2896 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
2897 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2898 v25 = 0;
|
|
2899 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
|
|
2900 {
|
|
2901 Party::TakeGold((signed __int64)v24);
|
|
2902 v26 = &pOutdoor->ddm;
|
|
2903 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
|
|
2904 v26 = &pIndoor->dlv;
|
|
2905 v27 = v26->uReputation;
|
|
2906 v66 = v26;
|
|
2907 if ( v27 > -5 )
|
|
2908 {
|
|
2909 v28 = v27 - 1;
|
|
2910 v26->uReputation = v28;
|
|
2911 if ( v28 < -5 )
|
|
2912 v26->uReputation = -5;
|
|
2913 }
|
|
2914 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
|
|
2915 {
|
|
2916 if ( v26->uReputation <= -5 )
|
|
2917 {
|
|
2918 v30 = pParty->uDaysPlayed % 7 + 1;
|
|
2919 LOBYTE(v30) = v30 | 0x80;
|
|
2920 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
|
|
2921 }
|
|
2922 if ( v26->uReputation <= -10 )
|
|
2923 {
|
|
2924 v31 = pParty->uDaysPlayed % 7 + 1;
|
|
2925 LOBYTE(v31) = v31 | 0x80;
|
|
2926 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
|
|
2927 v26 = v66;
|
|
2928 }
|
|
2929 if ( v26->uReputation <= -15 )
|
|
2930 {
|
|
2931 v32 = pParty->uDaysPlayed % 7 + 1;
|
|
2932 LOBYTE(v32) = v32 | 0x80;
|
|
2933 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0);
|
|
2934 v26 = v66;
|
|
2935 }
|
|
2936 if ( v26->uReputation <= -20 )
|
|
2937 {
|
|
2938 v33 = pParty->uDaysPlayed % 7 + 1;
|
|
2939 LOBYTE(v33) = v33 | 0x80;
|
|
2940 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0);
|
|
2941 v26 = v66;
|
|
2942 }
|
|
2943 if ( v26->uReputation <= -25 )
|
|
2944 {
|
|
2945 v34 = pParty->uDaysPlayed % 7 + 1;
|
|
2946 LOBYTE(v34) = v34 | 0x80;
|
|
2947 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0);
|
|
2948 }
|
|
2949 }
|
|
2950 ++byte_F8B1EF[uActiveCharacter];
|
|
2951 v1->PlaySound(SPEECH_83, 0);
|
|
2952 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
|
|
2953 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2954 return;
|
|
2955 }
|
|
2956 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
2957 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2958 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2959 return;
|
|
2960 }
|
|
2961 if ( !v1->IsPlayerHealableByTemple() )
|
|
2962 return;
|
|
2963 v25 = 0;
|
|
2964 if ( pParty->uNumGold < v2 )
|
|
2965 {
|
|
2966 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
2967 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2968 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2969 return;
|
|
2970 }
|
|
2971 Party::TakeGold(v2);
|
|
2972 v35 = LODWORD(v1->pConditions[17]);
|
|
2973 v59 = v1->pConditions[14];
|
|
2974 v58 = v1->pConditions[15];
|
|
2975 v60 = v1->pConditions[16];
|
|
2976 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
|
|
2977 memset(v1, 0, 0xA0u);
|
|
2978 v1->sHealth = v1->GetMaxHealth();
|
|
2979 v1->sMana = v1->GetMaxMana();
|
|
2980 v36 = (signed int)window_SpeakInHouse->ptr_1C;
|
|
2981 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
|
|
2982 {
|
|
2983 if ( (unsigned int)v61 | v35 )
|
|
2984 {
|
|
2985 v37 = LOBYTE(v1->uPrevFace);
|
|
2986 v38 = v1->uPrevVoiceID;
|
|
2987 v1->uCurrentFace = v37;
|
|
2988 v1->uVoiceID = v38;
|
|
2989 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
|
|
2990 }
|
|
2991 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
2992 v1->PlaySound(SPEECH_82, 0);
|
|
2993 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
2994 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2995 return;
|
|
2996 }
|
|
2997 v39 = v61;
|
|
2998 if ( (unsigned int)v61 | v35 )
|
|
2999 {
|
|
3000 LODWORD(v1->pConditions[17]) = v35;
|
|
3001 }
|
|
3002 else
|
|
3003 {
|
|
3004 if ( !v60 && !v58 && !v59 )
|
|
3005 {
|
|
3006 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
3007 v1->PlaySound(SPEECH_82, 0);
|
|
3008 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
3009 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
3010 return;
|
|
3011 }
|
|
3012 v1->uPrevFace = v1->uCurrentFace;
|
|
3013 v1->uPrevVoiceID = v1->uVoiceID;
|
|
3014 v1->SetCondition(0x11u, 1);
|
|
3015 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
|
|
3016 v40 = (v1->GetSexByVoice() != 0) + 23;
|
|
3017 v1->uCurrentFace = v40;
|
|
3018 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
|
|
3019 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
|
|
3020 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
|
|
3021 }
|
|
3022 HIDWORD(v1->pConditions[17]) = (int)v39;
|
|
3023 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
3024 v1->PlaySound(SPEECH_82, 0);
|
|
3025 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
3026 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
3027 return; // void func
|
|
3028 }
|
|
3029 v63 = 1;
|
|
3030 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
|
|
3031 strcpy(a1, "");
|
|
3032 v41->uHeight = 0;
|
|
3033 v41->uY = 0;
|
|
3034 if ( v1->IsPlayerHealableByTemple() )
|
|
3035 {
|
|
3036 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
|
|
3037 v63 = 0;
|
|
3038 }
|
|
3039 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
|
|
3040 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
|
|
3041 v42 = v63;
|
|
3042 v43 = pDialogueWindow;
|
|
3043 v44 = v63;
|
|
3044 v66 = 0;
|
|
3045 if ( v63 < pDialogueWindow->pNumPresenceButton )
|
|
3046 {
|
|
3047 v61 = (GUIWindow *)&a1[100 * v63];
|
|
3048 do
|
|
3049 {
|
|
3050 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
|
|
3051 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
|
|
3052 v43 = pDialogueWindow;
|
|
3053 v61 = (GUIWindow *)((char *)v61 + 100);
|
|
3054 ++v44;
|
|
3055 }
|
|
3056 while ( v44 < pDialogueWindow->pNumPresenceButton );
|
|
3057 }
|
|
3058 v46 = v43->pNumPresenceButton - v42;
|
|
3059 v64 = (174 - (signed int)v66) / v46;
|
|
3060 if ( v64 > 32 )
|
|
3061 v64 = 32;
|
|
3062 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
|
|
3063 v65 = v42 + v43->pStartingPosActiveItem;
|
|
3064 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
|
|
3065 {
|
|
3066 v61 = (GUIWindow *)(v42 + 2);
|
|
3067 v66 = (DDM_DLV_Header *)&a1[100 * v42];
|
|
3068 do
|
|
3069 {
|
|
3070 v48 = v43->GetControl(v65);
|
|
3071 v49 = (const char *)v66;
|
|
3072 v50 = v48;
|
|
3073 v48->uY = v64 + v47;
|
|
3074 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
|
|
3075 v52 = v50->uY;
|
|
3076 v50->uHeight = v51;
|
|
3077 v47 = v52 + v51 - 1;
|
|
3078 v50->uW = v47;
|
|
3079 v53 = WORD2(v59);
|
|
3080 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
|
|
3081 v53 = WORD2(v58);
|
|
3082 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
|
|
3083 v43 = pDialogueWindow;
|
|
3084 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
|
|
3085 v61 = (GUIWindow *)((char *)v61 + 1);
|
|
3086 ++v65;
|
|
3087 }
|
|
3088 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
3089 }
|
|
3090 return;
|
|
3091 }
|
|
3092
|
|
3093 //----- (004B4710) --------------------------------------------------------
|
|
3094 void TrainingDialog()
|
|
3095 {
|
|
3096 //Player *v0; // ebx@1
|
|
3097 int color2; // eax@1
|
|
3098 //unsigned int v2; // ecx@1
|
|
3099 //int v3; // eax@1
|
|
3100 //signed int v4; // edx@1
|
|
3101 unsigned __int64 v5; // edi@3
|
|
3102 //unsigned int v6; // esi@3
|
|
3103 //void *v7; // ecx@3
|
|
3104 int v8; // edx@4
|
|
3105 double v9; // st7@6
|
|
3106 signed int v10; // esi@6
|
|
3107 int v11; // ecx@6
|
|
3108 //int result; // eax@9
|
|
3109 GUIWindow *v13; // edi@14
|
|
3110 signed int v14; // esi@14
|
|
3111 unsigned int v15; // esi@16
|
|
3112 int v16; // eax@16
|
|
3113 unsigned int v17; // eax@17
|
|
3114 int v18; // eax@19
|
|
3115 int v19; // ecx@24
|
|
3116 GUIButton *v20; // eax@26
|
|
3117 GUIButton *v21; // esi@26
|
|
3118 int v22; // eax@26
|
|
3119 const char *v23; // eax@28
|
|
3120 int v24; // eax@28
|
|
3121 unsigned int v25; // ecx@28
|
|
3122 int v26; // eax@28
|
|
3123 unsigned __int16 v27; // ax@28
|
|
3124 //int v28; // eax@32
|
|
3125 unsigned __int16 v29; // ST14_2@34
|
|
3126 int v30; // eax@34
|
|
3127 //const char *v31; // ST18_4@36
|
|
3128 //unsigned __int16 v32; // ST14_2@36
|
|
3129 int v33; // eax@36
|
|
3130 int v34; // eax@37
|
|
3131 unsigned int v35; // edi@38
|
|
3132 unsigned int v36; // eax@38
|
|
3133 //int v37; // ecx@41
|
|
3134 //char *v38; // eax@41
|
|
3135 //int *v39; // eax@45
|
|
3136 unsigned int v40; // eax@46
|
|
3137 //void *v41; // ecx@46
|
|
3138 unsigned int v42; // eax@46
|
|
3139 GUIWindow *v43; // ecx@59
|
|
3140 int v44; // edx@59
|
|
3141 char **v45; // esi@60
|
|
3142 //int v46; // eax@62
|
|
3143 int v47; // eax@68
|
|
3144 //int v48; // edx@69
|
|
3145 int v49; // ebx@69
|
|
3146 //unsigned __int8 v50; // sf@69
|
|
3147 char **v51; // edi@70
|
|
3148 GUIButton *v52; // eax@71
|
|
3149 GUIButton *v53; // esi@71
|
|
3150 int v54; // eax@71
|
|
3151 unsigned int v55; // ecx@71
|
|
3152 int v56; // eax@71
|
|
3153 unsigned __int16 v57; // ax@71
|
|
3154 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
|
|
3155 //const char *v59; // [sp-Ch] [bp-90h]@63
|
|
3156 char *v60; // [sp-8h] [bp-8Ch]@38
|
|
3157 //char *v61; // [sp-8h] [bp-8Ch]@63
|
|
3158 unsigned int v62; // [sp-4h] [bp-88h]@38
|
|
3159 int v63; // [sp-4h] [bp-88h]@52
|
|
3160 //char *v64; // [sp-4h] [bp-88h]@63
|
|
3161 GUIWindow v65; // [sp+Ch] [bp-78h]@1
|
|
3162 //__int64 v66; // [sp+60h] [bp-24h]@3
|
|
3163 unsigned int white; // [sp+68h] [bp-1Ch]@1
|
|
3164 int v68; // [sp+6Ch] [bp-18h]@3
|
|
3165 int v69; // [sp+70h] [bp-14h]@6
|
|
3166 //unsigned int i; // [sp+74h] [bp-10h]@1
|
|
3167 //int v71; // [sp+78h] [bp-Ch]@1
|
|
3168 int v72; // [sp+7Ch] [bp-8h]@16
|
|
3169 int v73; // [sp+80h] [bp-4h]@14
|
|
3170
|
|
3171 //v0 = pPlayers[uActiveCharacter];
|
|
3172 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
|
|
3173 v65.uFrameX = 483;
|
|
3174 v65.uFrameWidth = 148;
|
|
3175 v65.uFrameZ = 334;
|
|
3176 white = TargetColor(255, 255, 255);
|
|
3177 color2 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3178 //v71 = color2;
|
|
3179 //v2 = v0->uLevel;
|
|
3180 //v3 = 0;
|
|
3181 //v4 = 0;
|
|
3182 //for ( i = v2; v4 < (signed int)v2; ++v4 )
|
|
3183 // v3 += v4 + 1;
|
|
3184 //v5 = 1000 * v3;
|
|
3185 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
|
|
3186 //v6 = HIDWORD(v0->uExperience);
|
|
3187 //v7 = window_SpeakInHouse->ptr_1C;
|
|
3188 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
|
|
3189 //v66 = 1000 * v3;
|
|
3190 if (pPlayers[uActiveCharacter]->uExperience >= v5)
|
|
3191 {
|
|
3192 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
|
|
3193 if ( v8 == 4 )
|
|
3194 v8 = 3;
|
|
3195 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
|
|
3196 //i = 0;
|
|
3197 v69 = v8;
|
|
3198 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
|
|
3199 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
|
|
3200 v11 = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
3201 if ( v11 < v10 / 3 )
|
|
3202 v11 = v10 / 3;
|
|
3203 //i = v11;
|
|
3204 }
|
|
3205
|
1393
|
3206 if (HouseUI_CheckIfPlayerCanInteract())
|
1298
|
3207 {
|
|
3208 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
|
|
3209 {
|
|
3210 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
3211 {
|
|
3212 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
|
|
3213 {
|
1393
|
3214 if (HouseUI_CheckIfPlayerCanInteract())
|
1298
|
3215 {
|
|
3216 //i = 0;
|
|
3217 int _v0 = 0;
|
|
3218 v13 = pDialogueWindow;
|
|
3219 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
|
|
3220 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
|
|
3221 v73 = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
3222 if ( v73 < v14 / 3 )
|
|
3223 v73 = v14 / 3;
|
|
3224 v15 = v13->pStartingPosActiveItem;
|
|
3225 v16 = v13->pNumPresenceButton;
|
|
3226 v72 = 0;
|
|
3227 if ( (signed int)v15 >= (signed int)(v15 + v16) )
|
|
3228 goto LABEL_76;
|
|
3229 do
|
|
3230 {
|
|
3231 v17 = v13->GetControl(v15)->msg_param - 36;
|
|
3232 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] && !pPlayers[uActiveCharacter]->pActiveSkills[v17] )
|
|
3233 {
|
|
3234 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
|
|
3235 _v0 += v18;
|
|
3236 ++v72;
|
|
3237 }
|
|
3238 ++v15;
|
|
3239 }
|
|
3240 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
|
|
3241 if ( v72 )
|
|
3242 {
|
|
3243 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
|
|
3244 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
3245 v73 = (signed int)(149 - _v0) / v72;
|
|
3246 if ( v73 > 32 )
|
|
3247 v73 = 32;
|
|
3248 //result = v13->pStartingPosActiveItem;
|
|
3249 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162;
|
|
3250 int _v1 = v13->pStartingPosActiveItem;
|
|
3251 v68 = v19;
|
|
3252 if (v13->pStartingPosActiveItem < v13->pStartingPosActiveItem + v13->pNumPresenceButton )
|
|
3253 {
|
|
3254 v72 = 2;
|
|
3255 do
|
|
3256 {
|
|
3257 v20 = v13->GetControl(_v1);
|
|
3258 v21 = v20;
|
|
3259 v22 = v20->msg_param - 36;
|
|
3260 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v22] || pPlayers[uActiveCharacter]->pActiveSkills[v22] )
|
|
3261 {
|
|
3262 v21->uW = 0;
|
|
3263 v21->uHeight = 0;
|
|
3264 v21->uY = 0;
|
|
3265 }
|
|
3266 else
|
|
3267 {
|
|
3268 v23 = pSkillNames[v22];
|
|
3269 v21->uY = v73 + v68;
|
|
3270 //HIDWORD(v66) = (int)v23;
|
|
3271 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
|
|
3272 v25 = v21->uY;
|
|
3273 v21->uHeight = v24;
|
|
3274 v26 = v25 + v24 - 1;
|
|
3275 v21->uW = v26;
|
|
3276 v68 = v26;
|
|
3277 v27 = color2;
|
|
3278 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
|
|
3279 v27 = white;
|
|
3280 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u);
|
|
3281 }
|
|
3282 ++_v1;
|
|
3283 ++v72;
|
|
3284 }
|
|
3285 while ( (signed int)_v1 < v13->pStartingPosActiveItem + v13->pNumPresenceButton );
|
|
3286 }
|
|
3287 }
|
|
3288 else
|
|
3289 {
|
|
3290 LABEL_76:
|
|
3291 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
|
|
3292 // "Seek knowledge elsewhere %s the %s"
|
|
3293 strcat(pTmpBuf.data(), "\n \n");
|
|
3294 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
|
|
3295 v29 = color2;
|
|
3296 v30 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0);
|
|
3297 v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf.data(), 3u);
|
|
3298 }
|
|
3299 }
|
|
3300 }
|
|
3301 return;
|
|
3302 }
|
1393
|
3303 if ( !HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
3304 {
|
|
3305 //v31 = pNPCTopics[122].pText;
|
|
3306 //v32 = color2;
|
|
3307 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
|
|
3308 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, color2, pNPCTopics[122].pText, 3);
|
|
3309 pDialogueWindow->pNumPresenceButton = 0;
|
|
3310 return;
|
|
3311 }
|
|
3312 v34 = pPlayers[uActiveCharacter]->uLevel;
|
|
3313 if ( v34 < v68 )
|
|
3314 {
|
|
3315 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
|
|
3316 {
|
|
3317 if ( pParty->uNumGold >= v11)
|
|
3318 {
|
|
3319 Party::TakeGold(v11);
|
|
3320 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
3321 ++pPlayers[uActiveCharacter]->uLevel;
|
|
3322 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
|
|
3323 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
|
|
3324 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
|
|
3325
|
|
3326 uint max_level_in_party = player_levels[0];
|
|
3327 for (uint _it = 1; _it < 4; ++_it)
|
|
3328 {
|
|
3329 if (player_levels[_it] > max_level_in_party)
|
|
3330 max_level_in_party = player_levels[_it];
|
|
3331 }
|
|
3332
|
|
3333 ++player_levels[uActiveCharacter - 1];
|
|
3334 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
|
|
3335 // feature is broken thou, since this array is always zeroed in EnterHouse
|
|
3336 {
|
|
3337 v40 = _494820_training_time(pParty->uCurrentHour);
|
|
3338 //v41 = window_SpeakInHouse->ptr_1C;
|
|
3339 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
|
|
3340 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
|
|
3341 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
|
|
3342 v42 += 720;
|
|
3343 RestAndHeal((signed int)(v42 + 10080));
|
|
3344 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
|
|
3345 pOutdoor->SetFog();
|
|
3346 }
|
|
3347 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
|
|
3348 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);//
|
|
3349 // "%s is now Level %lu and has earned %lu Skill Points!"
|
|
3350 ShowStatusBarString(pTmpBuf.data(), 2);
|
|
3351 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
3352 return;
|
|
3353 }
|
|
3354 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
|
|
3355 v63 = 4;
|
|
3356 LABEL_55:
|
|
3357 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v63);
|
|
3358 //LABEL_56:
|
|
3359 /*result = pMessageQueue_50CBD0->uNumMessages;
|
|
3360 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
3361 {
|
|
3362 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
|
|
3363 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
|
|
3364 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
|
|
3365 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
|
|
3366 ++pMessageQueue_50CBD0->uNumMessages;
|
|
3367 }
|
|
3368 return result;*/
|
|
3369 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
3370 return;
|
|
3371 }
|
|
3372 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);//
|
|
3373 // "You need %d more experience to train to level %d"
|
|
3374 v35 = 0;
|
|
3375 v62 = 3;
|
|
3376 v60 = pTmpBuf.data();
|
|
3377 v58 = color2;
|
|
3378 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 88;
|
|
3379 }
|
|
3380 else
|
|
3381 {
|
|
3382 sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
|
|
3383 // ""With your skills, you should be working here as a teacher.""
|
|
3384 // ""Sorry, but we are unable to train you.""
|
|
3385 v35 = 0;
|
|
3386 v62 = 3;
|
|
3387 v60 = pTmpBuf.data();
|
|
3388 v58 = color2;
|
|
3389 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 101;
|
|
3390 }
|
|
3391 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
|
|
3392 v63 = 3;
|
|
3393 goto LABEL_55;
|
|
3394 }
|
|
3395
|
1393
|
3396 if (HouseUI_CheckIfPlayerCanInteract())
|
1298
|
3397 {
|
|
3398 v43 = pDialogueWindow;
|
|
3399 v72 = 0;
|
|
3400 pShopOptions[0] = pTmpBuf.data();
|
|
3401 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
|
|
3402 v44 = pDialogueWindow->pNumPresenceButton;
|
|
3403 v73 = pDialogueWindow->pStartingPosActiveItem;
|
|
3404 if ( v73 < v73 + v44 )
|
|
3405 {
|
|
3406 v45 = pShopOptions.data();
|
|
3407 do
|
|
3408 {
|
|
3409 if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
3410 {
|
|
3411 //v46 = pPlayers[uActiveCharacter]->uLevel;
|
|
3412 if (pPlayers[uActiveCharacter]->uLevel >= v68)
|
|
3413 sprintfex(*v45, "%s\n \n%s",
|
|
3414 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."
|
|
3415 else
|
|
3416 {
|
|
3417 if (pPlayers[uActiveCharacter]->uExperience < v5)
|
|
3418 sprintfex(*v45, pGlobalTXT_LocalizationStrings[538], // "You need %d more experience to train to level %d"
|
|
3419 (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);
|
|
3420 else
|
|
3421 sprintfex(*v45, pGlobalTXT_LocalizationStrings[537], // "Train to level %d for %d gold"
|
|
3422 pPlayers[uActiveCharacter]->uLevel + 1, v11);
|
|
3423 }
|
|
3424 }
|
|
3425 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
|
|
3426 v43 = pDialogueWindow;
|
|
3427 v72 += v47;
|
|
3428 ++v45;
|
|
3429 ++v73;
|
|
3430 }
|
|
3431 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
3432 }
|
|
3433
|
|
3434 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
|
|
3435 v73 = v43->pStartingPosActiveItem;
|
|
3436 if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
|
|
3437 {
|
|
3438 int _v3 = 2;
|
|
3439 v51 = pShopOptions.data();
|
|
3440 do
|
|
3441 {
|
|
3442 v52 = v43->GetControl(v73);
|
|
3443 v53 = v52;
|
|
3444 v52->uY = (174 - v72) / 2 + v49;
|
|
3445 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
|
|
3446 v55 = v53->uY;
|
|
3447 v53->uHeight = v54;
|
|
3448 v56 = v54 + v55 - 1;
|
|
3449 v53->uW = v56;
|
|
3450 v49 = v56;
|
|
3451 v57 = color2;
|
|
3452 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 )
|
|
3453 v57 = white;
|
|
3454 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
|
|
3455 v43 = pDialogueWindow;
|
|
3456 ++_v3;
|
|
3457 ++v51;
|
|
3458 ++v73;
|
|
3459 }
|
|
3460 while ( v73 < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton);
|
|
3461 }
|
|
3462 }
|
|
3463 }
|
|
3464 }
|
|
3465
|
|
3466 //----- (004B6478) --------------------------------------------------------
|
|
3467 void sub_4B6478()
|
|
3468 {
|
|
3469 GUIWindow *v0; // ebx@1
|
|
3470 Player *v1; // edi@1
|
|
3471 unsigned int v2; // eax@1
|
|
3472 signed int v3; // esi@1
|
|
3473 int v4; // ebx@1
|
|
3474 unsigned int v5; // esi@5
|
|
3475 int v6; // edi@6
|
|
3476 int result; // eax@13
|
|
3477 GUIWindow *v8; // ebx@17
|
|
3478 int v9; // eax@17
|
|
3479 int v10; // ecx@17
|
|
3480 unsigned int v11; // ecx@18
|
|
3481 int v12; // eax@20
|
|
3482 int v13; // eax@21
|
|
3483 GUIButton *v14; // esi@27
|
|
3484 int v15; // ecx@27
|
|
3485 unsigned int v16; // eax@28
|
|
3486 const char *v17; // ebx@29
|
|
3487 int v18; // eax@29
|
|
3488 unsigned int v19; // ecx@29
|
|
3489 int v20; // eax@29
|
|
3490 unsigned __int16 v21; // ax@29
|
|
3491 unsigned __int16 v22; // ST14_2@36
|
|
3492 int v23; // eax@36
|
|
3493 const char *v24; // ST18_4@37
|
|
3494 unsigned __int16 v25; // ST14_2@37
|
|
3495 int v26; // eax@37
|
|
3496 int v27; // [sp-4h] [bp-80h]@8
|
|
3497 GUIWindow v28; // [sp+Ch] [bp-70h]@1
|
|
3498 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
|
|
3499 unsigned int v30; // [sp+64h] [bp-18h]@1
|
|
3500 int v31; // [sp+68h] [bp-14h]@1
|
|
3501 int v32; // [sp+6Ch] [bp-10h]@1
|
|
3502 int v33; // [sp+70h] [bp-Ch]@17
|
|
3503 int v34; // [sp+74h] [bp-8h]@17
|
|
3504 int v35; // [sp+78h] [bp-4h]@17
|
|
3505
|
|
3506 v0 = window_SpeakInHouse;
|
|
3507 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
|
|
3508 v1 = pPlayers[uActiveCharacter];
|
|
3509 v28.uFrameX = 483;
|
|
3510 v28.uFrameWidth = 148;
|
|
3511 v28.uFrameZ = 334;
|
|
3512 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3513 v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
3514 v2 = 52 * (unsigned int)v0->ptr_1C;
|
|
3515 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
|
|
3516 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
|
|
3517 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
|
|
3518 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
|
|
3519 v4 = v3 * (100 - v1->GetMerchant()) / 100;
|
|
3520 v32 = v4;
|
|
3521 if ( v4 < v3 / 3 )
|
|
3522 {
|
|
3523 v4 = v3 / 3;
|
|
3524 v32 = v3 / 3;
|
|
3525 }
|
|
3526 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
|
|
3527 {
|
1393
|
3528 if ( HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
3529 {
|
|
3530 v5 = 0;
|
|
3531
|
|
3532 __debugbreak();
|
|
3533 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
|
|
3534 // or
|
|
3535 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
|
|
3536 // or
|
|
3537 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
|
|
3538 __debugbreak(); // whacky condition - fix
|
|
3539 if (false
|
|
3540 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
|
|
3541 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
|
|
3542 {
|
|
3543 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
|
|
3544 }
|
|
3545 else
|
|
3546 {
|
|
3547 if ( pParty->uNumGold < v4 )
|
|
3548 {
|
|
3549 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
3550 v27 = 4;
|
|
3551 }
|
|
3552 else
|
|
3553 {
|
|
3554 Party::TakeGold(v4);
|
|
3555 *(short *)v6 = 1;
|
|
3556 v27 = 2;
|
|
3557 }
|
|
3558 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
|
|
3559 }
|
|
3560 }
|
|
3561 else
|
|
3562 {
|
|
3563 v5 = 0;
|
|
3564 }
|
|
3565 /*result = pMessageQueue_50CBD0->uNumMessages;
|
|
3566 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
3567 {
|
|
3568 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
|
|
3569 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
|
|
3570 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
|
|
3571 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
|
|
3572 ++pMessageQueue_50CBD0->uNumMessages;
|
|
3573 }*/
|
|
3574 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
|
|
3575 return; // void func
|
|
3576 }
|
|
3577 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
|
|
3578 {
|
|
3579 v24 = pNPCTopics[171].pText;
|
|
3580 v25 = v31;
|
|
3581 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
|
|
3582 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
|
|
3583 pDialogueWindow->pNumPresenceButton = 0;
|
|
3584 return ;
|
|
3585 }
|
|
3586
|
1393
|
3587 if ( !HouseUI_CheckIfPlayerCanInteract() )
|
1298
|
3588 return;
|
|
3589 v8 = pDialogueWindow;
|
|
3590 v33 = 0;
|
|
3591 v34 = 0;
|
|
3592 v29 = pDialogueWindow;
|
|
3593 v9 = pDialogueWindow->pStartingPosActiveItem;
|
|
3594 v10 = v9 + pDialogueWindow->pNumPresenceButton;
|
|
3595 v35 = pDialogueWindow->pStartingPosActiveItem;
|
|
3596 if ( v9 >= v10 )
|
|
3597 goto LABEL_40;
|
|
3598 do
|
|
3599 {
|
|
3600 v11 = v8->GetControl(v35)->msg_param - 36;
|
|
3601 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
|
|
3602 {
|
|
3603 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
|
|
3604 v33 += v12;
|
|
3605 ++v34;
|
|
3606 }
|
|
3607 v13 = v8->pStartingPosActiveItem;
|
|
3608 ++v35;
|
|
3609 }
|
|
3610 while ( v35 < v8->pNumPresenceButton + v13 );
|
|
3611 if ( !v34 )
|
|
3612 {
|
|
3613 LABEL_40:
|
|
3614 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
|
|
3615 strcat(pTmpBuf.data(), "\n \n");
|
|
3616 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
3617 v22 = v31;
|
|
3618 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
|
|
3619 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
|
|
3620 return;
|
|
3621 }
|
|
3622 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
|
|
3623 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
3624 v32 = (149 - v33) / v34;
|
|
3625 if ( (149 - v33) / v34 > 32 )
|
|
3626 v32 = 32;
|
|
3627
|
|
3628 v35 = v8->pStartingPosActiveItem;
|
|
3629 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
|
|
3630 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
|
|
3631 {
|
|
3632 v33 = 2;
|
|
3633 do
|
|
3634 {
|
|
3635 v14 = v8->GetControl(v35);
|
|
3636 v15 = v14->msg_param - 36;
|
|
3637 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
|
|
3638 {
|
|
3639 v16 = 0;
|
|
3640 if ( !v1->pActiveSkills[v15] )
|
|
3641 {
|
|
3642 v17 = pSkillNames[v15];
|
|
3643 v14->uY = v32 + v34;
|
|
3644 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
|
|
3645 v19 = v14->uY;
|
|
3646 v14->uHeight = v18;
|
|
3647 v20 = v19 + v18 - 1;
|
|
3648 v14->uW = v20;
|
|
3649 v34 = v20;
|
|
3650 v21 = v31;
|
|
3651 if ( pDialogueWindow->pCurrentPosActiveItem != v33 )
|
|
3652 v21 = v30;
|
|
3653 v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u);
|
|
3654 goto LABEL_34;
|
|
3655 }
|
|
3656 }
|
|
3657 else
|
|
3658 {
|
|
3659 v16 = 0;
|
|
3660 }
|
|
3661 v14->uW = v16;
|
|
3662 v14->uHeight = v16;
|
|
3663 v14->uY = v16;
|
|
3664 LABEL_34:
|
|
3665 v8 = v29;
|
|
3666 ++v35;
|
|
3667 ++v33;
|
|
3668 }
|
|
3669 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
|
|
3670 }
|
|
3671 return;
|
|
3672 }
|
|
3673
|
|
3674 //----- (004B2A74) --------------------------------------------------------
|
|
3675 void SimpleHouseAndBoatsDialog()
|
|
3676 {
|
|
3677 char *v0; // esi@3
|
|
3678 char *v1; // ST1C_4@3
|
|
3679 char *v2; // eax@3
|
|
3680 const char *v3; // ST1C_4@5
|
|
3681 int v4; // eax@5
|
|
3682 unsigned int i; // eax@5
|
|
3683 NPCData *v6; // esi@6
|
|
3684 unsigned __int16 v7; // bx@6
|
|
3685 unsigned int v8; // eax@6
|
|
3686 int v9; // eax@11
|
|
3687 unsigned int v10; // ecx@12
|
|
3688 int v11; // eax@12
|
|
3689 int v12; // esi@12
|
|
3690 char *v13; // eax@12
|
|
3691 GUIWindow *v14; // ebx@13
|
|
3692 char *v15; // esi@14
|
|
3693 GUIButton *v16; // eax@15
|
|
3694 unsigned int v17; // ecx@15
|
|
3695 int v18; // ecx@17
|
|
3696 int v19; // ecx@18
|
|
3697 int v20; // ecx@19
|
|
3698 int v21; // ecx@20
|
|
3699 int v22; // ecx@21
|
|
3700 unsigned int v23; // ecx@23
|
|
3701 int v24; // ecx@35
|
|
3702 int v25; // ecx@36
|
|
3703 int v26; // ecx@37
|
|
3704 int v27; // ecx@38
|
|
3705 int v28; // ecx@39
|
|
3706 char *v29; // esi@42
|
|
3707 unsigned int v30; // ST20_4@42
|
|
3708 int v31; // ST1C_4@42
|
|
3709 unsigned int v32; // eax@42
|
|
3710 char *v33; // eax@43
|
|
3711 int v34; // esi@51
|
|
3712 int v35; // eax@51
|
|
3713 unsigned int v36; // edi@51
|
|
3714 GUIButton *v37; // eax@52
|
|
3715 int v38; // eax@52
|
|
3716 signed int v39; // ecx@54
|
|
3717 int v40; // edi@57
|
|
3718 GUIButton *v41; // eax@60
|
|
3719 GUIButton *v42; // esi@60
|
|
3720 const char *v43; // ebx@60
|
|
3721 int v44; // eax@60
|
|
3722 unsigned int v45; // ecx@60
|
|
3723 unsigned __int16 v46; // ax@60
|
|
3724 GUIFont *v47; // ebx@64
|
|
3725 int v48; // esi@64
|
|
3726 char *v49; // eax@66
|
|
3727 GUIWindow w; // [sp+Ch] [bp-110h]@64
|
|
3728 GUIWindow v52; // [sp+60h] [bp-BCh]@13
|
|
3729 GUIWindow a1; // [sp+B4h] [bp-68h]@1
|
|
3730 unsigned int v54; // [sp+108h] [bp-14h]@14
|
|
3731 int v55; // [sp+10Ch] [bp-10h]@6
|
|
3732 int v56; // [sp+110h] [bp-Ch]@13
|
|
3733 char *pInString; // [sp+114h] [bp-8h]@12
|
|
3734 NPCData *v58; // [sp+118h] [bp-4h]@6
|
|
3735
|
|
3736 memcpy(&a1, pDialogueWindow, sizeof(a1));
|
|
3737 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
|
|
3738 {
|
|
3739 v0 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
3740 v1 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
3741 a1.uFrameX = 493;
|
|
3742 a1.uFrameWidth = 126;
|
|
3743 a1.uFrameZ = 366;
|
|
3744 a1.DrawTitleText(pFontCreate, 0, 2u, 0, v1, 3u);
|
|
3745 a1.uFrameX = 483;
|
|
3746 a1.uFrameWidth = 148;
|
|
3747 a1.uFrameZ = 334;
|
|
3748 v2 = pTransitionStrings[uHouse_ExitPic];
|
|
3749 if ( !v2 )
|
|
3750 {
|
|
3751 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[411], v0);
|
|
3752 v2 = pTmpBuf.data();
|
|
3753 }
|
|
3754 v3 = v2;
|
|
3755 v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
|
|
3756 a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
|
|
3757 return;
|
|
3758 }
|
|
3759 a1.uFrameWidth -= 10;
|
|
3760 a1.uFrameZ -= 10;
|
|
3761 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1
|
|
3762 v6 = v58;
|
|
3763 v55 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3764 v7 = TargetColor(0x15u, 0x99u, 0xE9u);
|
|
3765 v8 = v6->uProfession;
|
|
3766 if ( v8 )
|
|
3767 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
|
|
3768 else
|
|
3769 strcpy(pTmpBuf.data(), v6->pName);
|
|
3770 a1.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf.data(), 3u);
|
|
3771 if ( !dword_591080 )
|
|
3772 {
|
|
3773 if ( !uDialogueType )
|
|
3774 {
|
|
3775 v9 = v6->greet;
|
|
3776 if ( v9 )
|
|
3777 {
|
|
3778 v10 = v6->uFlags;
|
|
3779 a1.uFrameWidth = game_viewport_width;
|
|
3780 a1.uFrameZ = 452;
|
|
3781 pInString = (char *)*(&pNPCStats->field_17884 + ((v10 & 3) == 2) + 2 * v9);
|
|
3782 v11 = pFontArrus->CalcTextHeight(pInString, &a1, 13, 0);
|
|
3783 v12 = v11 + 7;
|
|
3784 pRenderer->_4A6A68(8, 352 - (v11 + 7),
|
|
3785 pIcons_LOD->GetTexture(uTextureID_Leather),
|
|
3786 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - (v11 + 7));
|
|
3787 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
|
|
3788 v13 = FitTextInAWindow(pInString, pFontArrus, &a1, 0xDu, 0);
|
|
3789 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
|
|
3790 }
|
|
3791 }
|
|
3792 }
|
|
3793 v14 = pDialogueWindow;
|
|
3794 memcpy(&v52, pDialogueWindow, sizeof(v52));
|
|
3795 v52.uFrameX = 483;
|
|
3796 v52.uFrameWidth = 148;
|
|
3797 v52.uFrameZ = 334;
|
|
3798 v56 = v52.pStartingPosActiveItem;
|
|
3799 if ( v52.pStartingPosActiveItem < v52.pStartingPosActiveItem + v52.pNumPresenceButton )
|
|
3800 {
|
|
3801 v15 = "";//(char *)v54;
|
|
3802 while ( 1 )
|
|
3803 {
|
|
3804 v16 = v52.GetControl(v56);
|
|
3805 v17 = v16->msg_param;
|
|
3806 pInString = (char *)v16;
|
|
3807 if ( (signed int)v17 > 24 )
|
|
3808 {
|
|
3809 v24 = v17 - 76;
|
|
3810 if ( !v24 )
|
|
3811 {
|
|
3812 v15 = pGlobalTXT_LocalizationStrings[406];
|
|
3813 goto LABEL_49;
|
|
3814 }
|
|
3815 v25 = v24 - 1;
|
|
3816 if ( !v25 )
|
|
3817 {
|
|
3818 v15 = pGlobalTXT_LocalizationStrings[407];
|
|
3819 goto LABEL_49;
|
|
3820 }
|
|
3821 v26 = v25 - 2;
|
|
3822 if ( !v26 )
|
|
3823 {
|
|
3824 v33 = _4B254D_SkillMasteryTeacher((int)v52.ptr_1C);
|
|
3825 LABEL_44:
|
|
3826 v15 = v33;
|
|
3827 LABEL_45:
|
|
3828 v16 = (GUIButton *)pInString;
|
|
3829 goto LABEL_49;
|
|
3830 }
|
|
3831 v27 = v26 - 3;
|
|
3832 if ( !v27 )
|
|
3833 {
|
|
3834 v33 = (char *)ContractSelectText((int)v52.ptr_1C);
|
|
3835 goto LABEL_44;
|
|
3836 }
|
|
3837 v28 = v27 - 1;
|
|
3838 if ( !v28 )
|
|
3839 {
|
|
3840 v29 = (char *)&pMonsterStats + 88 * word_F8B1A0;
|
|
3841 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3842 v31 = *(int *)v29;
|
|
3843 v32 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
3844 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", v32, v31, v30);
|
|
3845 sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
|
|
3846 current_npc_text = pTmpBuf2.data();
|
|
3847 v15 = "";
|
|
3848 goto LABEL_45;
|
|
3849 }
|
|
3850 if ( v28 != 10 )
|
|
3851 goto LABEL_41;
|
|
3852 }
|
|
3853 else
|
|
3854 {
|
|
3855 if ( v17 == 24 )
|
|
3856 {
|
|
3857 v23 = v58->evt_F;
|
|
3858 LABEL_33:
|
|
3859 v15 = (char *)pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
|
|
3860 if ( !v15 )
|
|
3861 {
|
|
3862 v16->msg_param = 0;
|
|
3863 v15 = "";
|
|
3864 }
|
|
3865 goto LABEL_49;
|
|
3866 }
|
|
3867 v18 = v17 - 13;
|
|
3868 if ( v18 )
|
|
3869 {
|
|
3870 v19 = v18 - 6;
|
|
3871 if ( !v19 )
|
|
3872 {
|
|
3873 v23 = v58->evt_A;
|
|
3874 goto LABEL_33;
|
|
3875 }
|
|
3876 v20 = v19 - 1;
|
|
3877 if ( !v20 )
|
|
3878 {
|
|
3879 v15 = (char *)pNPCTopics[v58->evt_B-1].pTopic;//(&dword_721660)[8 * v58->evtb];
|
|
3880 if ( !v15 )
|
|
3881 {
|
|
3882 v16->msg_param = 0;
|
|
3883 v15 = "";
|
|
3884 }
|
|
3885 if ( uDialogueType != 84 )
|
|
3886 goto LABEL_49;
|
|
3887 sprintf(pTmpBuf.data(), format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
|
|
3888 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
|
|
3889 current_npc_text = pTmpBuf2.data();
|
|
3890 goto LABEL_45;
|
|
3891 }
|
|
3892 v21 = v20 - 1;
|
|
3893 if ( !v21 )
|
|
3894 {
|
|
3895 v23 = v58->evt_C;
|
|
3896 goto LABEL_33;
|
|
3897 }
|
|
3898 v22 = v21 - 1;
|
|
3899 if ( !v22 )
|
|
3900 {
|
|
3901 v23 = v58->evt_D;
|
|
3902 goto LABEL_33;
|
|
3903 }
|
|
3904 if ( v22 == 1 )
|
|
3905 {
|
|
3906 v23 = v58->evt_E;
|
|
3907 goto LABEL_33;
|
|
3908 }
|
|
3909 LABEL_41:
|
|
3910 v15 = "";
|
|
3911 goto LABEL_49;
|
|
3912 }
|
|
3913 v15 = pGlobalTXT_LocalizationStrings[122];
|
|
3914 }
|
|
3915 LABEL_49:
|
|
3916 strcpy(v16->pButtonName, v15);
|
|
3917 ++v56;
|
|
3918 if ( v56 >= v52.pStartingPosActiveItem + v52.pNumPresenceButton )
|
|
3919 {
|
|
3920 v14 = pDialogueWindow;
|
|
3921 break;
|
|
3922 }
|
|
3923 }
|
|
3924 }
|
|
3925 v34 = 0;
|
|
3926 v54 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3927 v35 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3928 v36 = v14->pStartingPosActiveItem;
|
|
3929 v55 = v35;
|
|
3930 for ( i = v36 + v14->pNumPresenceButton; (signed int)v36 < (signed int)i; i = pDialogueWindow->pNumPresenceButton
|
|
3931 + pDialogueWindow->pStartingPosActiveItem )
|
|
3932 {
|
|
3933 v37 = v14->GetControl(v36);
|
|
3934 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
|
|
3935 v14 = pDialogueWindow;
|
|
3936 v34 += v38;
|
|
3937 ++v36;
|
|
3938 }
|
|
3939 v39 = v14->pNumPresenceButton;
|
|
3940 if ( v39 )
|
|
3941 {
|
|
3942 v58 = (NPCData *)((174 - v34) / v39);
|
|
3943 if ( (signed int)v58 > 32 )
|
|
3944 v58 = (NPCData *)32;
|
|
3945 pInString = (char *)2;
|
|
3946 v40 = (174 - (signed int)v58 * v39 - v34) / 2 - (signed int)v58 / 2 + 138;
|
|
3947 v56 = v14->pStartingPosActiveItem;
|
|
3948 i = v56;
|
|
3949 if ( (signed int)i < (signed int)(i + v39) )
|
|
3950 {
|
|
3951 while ( 1 )
|
|
3952 {
|
|
3953 v41 = v14->GetControl(i);
|
|
3954 v42 = v41;
|
|
3955 v43 = v41->pButtonName;
|
|
3956 v41->uY = (unsigned int)((char *)v58 + v40);
|
|
3957 v44 = pFontArrus->CalcTextHeight(v41->pButtonName, &v52, 0, 0);
|
|
3958 v45 = v42->uY;
|
|
3959 v42->uHeight = v44;
|
|
3960 v40 = v45 + v44 - 1;
|
|
3961 v42->uW = v40;
|
|
3962 v46 = v55;
|
|
3963 if ( (char *)pDialogueWindow->pCurrentPosActiveItem != pInString )
|
|
3964 v46 = v54;
|
|
3965 v52.DrawTitleText(pFontArrus, 0, v45, v46, v43, 3u);
|
|
3966 v14 = pDialogueWindow;
|
|
3967 ++pInString;
|
|
3968 ++v56;
|
|
3969 i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
|
|
3970 if ( v56 >= (signed int)i )
|
|
3971 break;
|
|
3972 i = v56;
|
|
3973 }
|
|
3974 }
|
|
3975 }
|
|
3976 if ( current_npc_text )
|
|
3977 {
|
|
3978 w.uFrameWidth = 458;
|
|
3979 w.uFrameZ = 457;
|
|
3980 v47 = pFontArrus;
|
|
3981 v48 = pFontArrus->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
3982 if ( 352 - v48 < 8 )
|
|
3983 {
|
|
3984 v47 = pFontCreate;
|
|
3985 v48 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
3986 }
|
|
3987 pRenderer->_4A6A68(8, 352 - v48,
|
|
3988 pIcons_LOD->GetTexture(uTextureID_Leather),
|
|
3989 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v48);
|
|
3990 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428);
|
|
3991 v49 = FitTextInAWindow(current_npc_text, v47, &w, 0xDu, 0);
|
|
3992 a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
|
|
3993 }
|
|
3994 }
|
1300
|
3995 //----- (004B4F4F) --------------------------------------------------------
|
|
3996 void JailDialog()
|
1298
|
3997 {
|
1300
|
3998 const char *v0; // esi@1
|
|
3999 const char *v1; // ST10_4@1
|
|
4000 unsigned __int16 v2; // ST0C_2@1
|
|
4001 int v3; // eax@1
|
|
4002 GUIWindow v5; // [sp+8h] [bp-54h]@1
|
1298
|
4003
|
1300
|
4004 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
|
|
4005 v0 = pGlobalTXT_LocalizationStrings[672];
|
|
4006 v1 = pGlobalTXT_LocalizationStrings[672];
|
|
4007 v5.uFrameX = 483;
|
|
4008 v5.uFrameWidth = 148;
|
|
4009 v5.uFrameZ = 334;
|
|
4010 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
4011 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
|
|
4012 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
|
1298
|
4013 } |